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

The VirtualCharacter doesn't find the ground contacts when mMaxSlopeAngle is above 60 degrees #892

Closed
AndreaCatania opened this issue Jan 30, 2024 · 4 comments

Comments

@AndreaCatania
Copy link
Contributor

Hello, I'm debugging an issue on the virtual character which is failing to gather the contact with this moving platform, so it's not able to stay on it.

2024-01-30.19-02-01.mp4

I've noticed that this bug goes away by reducing the mMaxSlopeAngle to anything below 55 degrees.

2024-01-30.18-50-20.mp4

Anything above 55 degrees (in radians 0.959931) cause this issue. Maybe there is something which is clamped to 1?
This bug is quite noticeable with 60 / 70 degrees.

@AndreaCatania
Copy link
Contributor Author

Just after posting this I've discovered that reducing mMaxSlopeAngle is not fixing it. This bug happens randomly and I've the impression there is some undefined behavior somewhere, I'm double checking all my code once again and update this issue once I've better results.

@jrouwe
Copy link
Owner

jrouwe commented Jan 30, 2024

This is one of the test cases in the CharacterVirtualTest:

CharacterVirtualTest.mp4

so I would expect this to work.

Is the platform maybe moved by updating its position (BodyInterface::SetPosition) instead of moving it kinematically (BodyInterface::MoveKinematic)? This would cause the CharacterVirtual to be unable to follow the platform since the velocity is not set. I can also imagine this being client/server specific where the server moves a platform kinematically and the client just follows it by setting the position.

Perhaps you can try to alter CharacterVirtualTest with the parameters of your in game platform to see if you can repro it?

@AndreaCatania
Copy link
Contributor Author

Is the platform maybe moved by updating its position

Nope, it's moved by changing its LinearVelocity.

I can also imagine this being client/server specific where the server ...

This can't be the case as the platform is simulated on both the client and the server.

Perhaps you can try to alter CharacterVirtualTest with the parameters of your in game platform to see if you can repro it?

I'll try reproducing it there; something to note is that the platform is using a convex shape not a primitive box, maybe that's the problem? This is just a guess though.

@AndreaCatania
Copy link
Contributor Author

AndreaCatania commented Jan 31, 2024

Apparently re-implementing the platform movement using MoveKinematic fixes the problem (at least for now). The MoveKinematic function is not doing much other than setting the linear velocity as I was doing, not sure why directly set the linear velocity was causing that issue.
I'm closing this issue for now, and open it again if this issue appears again (which is totally possible).

Thanks for the help!!

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

2 participants