Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
campbellgoe opened this issue May 4, 2024 · 11 comments
Open

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

campbellgoe opened this issue May 4, 2024 · 11 comments

Comments

@campbellgoe
Copy link

campbellgoe commented May 4, 2024

I have a custom character model (who will have animations at a later date)
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
Copy link
Author

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

@campbellgoe
Copy link
Author

campbellgoe commented May 4, 2024

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
Copy link
Author

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

@campbellgoe
Copy link
Author

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

@campbellgoe
Copy link
Author

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

@campbellgoe
Copy link
Author

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
Copy link
Author

Fixed with floatingDis=1.5

@campbellgoe
Copy link
Author

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

@campbellgoe
Copy link
Author

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

@campbellgoe
Copy link
Author

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant