ecctrl icon indicating copy to clipboard operation
ecctrl copied to clipboard

How to define the character/player collision box/cuboid?

Open campbellgoe opened this issue 1 year ago • 12 comments

I have a custom character model (who will have animations at a later date) <BaseMale/> I visualise the cuboid with a Box. I add the CuboidCollider inside Ecctrl. The player finds the floor very bouncy and flies into the sky.

<Ecctrl debug ref={ecctrlRef} autoBalance={false} animated position={pos} jumpVel={0}>
    {/* <EcctrlAnimation characterURL={characterURL} animationSet={animationSet}> */}
    <CuboidCollider args={[1,2.15,1]} mass={0} position={[0,0.5,0]}/>
    <Box args={[1,2.15,1]} position={[0,0.5,0]} />
    <BaseMale scale={0.8} position={[0,-0.9,0]}/>
    {/* </EcctrlAnimation> */}
  </Ecctrl>

Screenshot 2024-05-04 075608

campbellgoe avatar May 04 '24 06:05 campbellgoe

Also, my character origin point as it its feet. When I first imported it, he was floating.

campbellgoe avatar May 04 '24 07:05 campbellgoe

To be honest, this problem goes away when removing debug from Ecctrl.

It's designed to apply a bunch of values or something but this debug doesn't help then does it.

Surely debug should not change anything so it should use defaults right?

Indeed, when I disable autoBalance={false} and apply debug, it applies autoBalance: true due to debug prop.

campbellgoe avatar May 04 '24 07:05 campbellgoe

Next problem, after disabling spinAndFlyToOrbit with autoBalance={false}, the character is floating in the air.

campbellgoe avatar May 04 '24 07:05 campbellgoe

I got it working by changing args and y position. :)

campbellgoe avatar May 04 '24 07:05 campbellgoe

Sorry now there is no friction and the player...this is so confusing to just define a custom character.

campbellgoe avatar May 04 '24 07:05 campbellgoe

Now the floor has geometry which makes it get stuck on cannot walk past. I think I must have the wrong settings. What is floatingDis? image

campbellgoe avatar May 04 '24 07:05 campbellgoe

Fixed with floatingDis=1.5

campbellgoe avatar May 04 '24 08:05 campbellgoe

Now sometimes I load in, character is bouncing off the floor. What settings is this? Bounciness?

campbellgoe avatar May 05 '24 06:05 campbellgoe

I tried changing settings, and maybe it stops the bounciness, but now the floor has no friction. Please help.

campbellgoe avatar May 07 '24 07:05 campbellgoe

OK well the best way i could get it when your character origin point is at its feet, was with this but the bounciness is a problem here, not friction. debug doesn't help.

<Ecctrl dampingC={0.5} floatingDis={1.5} ref={ecctrlRef} autoBalance={false} animated position={pos} jumpVel={0}>
    {/* <EcctrlAnimation characterURL={characterURL} animationSet={animationSet}> */}
    <CuboidCollider args={[0.5, 1.9, 0.2]} mass={0} position-y={-0.35} />
    {/* <Box args={[0.5,1.9,0.2]} position-y={-0.35} />  */}
    <BaseCharacter character={character} scale={0.8} position-y={-1.9} />
    {/* </EcctrlAnimation> */}
</Ecctrl>```

campbellgoe avatar May 07 '24 07:05 campbellgoe

Ahh bounciness is gone when reducing dampingC fro 0.5 to 0.1 (trial and error)

campbellgoe avatar May 07 '24 07:05 campbellgoe

Hey @campbellgoe, huge thanks for pointing out these problems and what parameters you tweaked to overcome them! it help me a lot with something similar. It's kinda hard to use a custom model! Cheers mate!

bass3l avatar Sep 30 '24 19:09 bass3l