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

Look into Rapier Character Controller #20

Open
qhdwight opened this issue May 3, 2023 · 7 comments
Open

Look into Rapier Character Controller #20

qhdwight opened this issue May 3, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@qhdwight
Copy link
Owner

qhdwight commented May 3, 2023

https://rapier.rs/docs/user_guides/bevy_plugin/character_controller/

@qhdwight qhdwight added the enhancement New feature or request label May 3, 2023
@FastestMolasses
Copy link
Contributor

Hey, still looking to add this? I implemented a basic version and was able to remove your auto step code. The one provided works really smoothly. There are some things that I didnt replace with the controller such as the ground casts, but this is at least a good stepping stone if you want to incorporate it. Let me know and I'll make a PR!

@qhdwight
Copy link
Owner Author

Oh definitely - I remember trying to implement it myself a few months ago and it was not so smooth.

Feel free to open a PR and I can take another look.

@qhdwight
Copy link
Owner Author

Starting some work on the rapier-character-controller branch

@FastestMolasses
Copy link
Contributor

Thanks for reminding me! Ill commit my changes to that branch sometime today!

@qhdwight
Copy link
Owner Author

Think we need to use effective_translation somehow from KinematicCharacterControllerOutput.

For example when the player runs into a wall they should not keep all of their velocity. It does have some weird side effects though that cause jitter, especially when jumping against a wall.

@FastestMolasses
Copy link
Contributor

Increasing the offset removed the jitters but it still doesn't let the player slide across the walls when moving. I also notice that sometimes the velocity doesn't go down to zero when moving slowly and there's an extra weird force (?) when trying to step over a step. Will try to help debug these issues.

@FastestMolasses
Copy link
Contributor

So after some research, it looks like the way collision detection works in the rapier character controller is causing the player to hang by setting it's velocity to 0. This is most obvious if you try jumping and hitting your head on the ceiling of something. With your current character controller, the player will immediately fall back down. With the rapier one, the player will stick to the ceiling for a second before falling back down. Currently I dont know if this can be solved without making a PR to rapier. Will continue to look into it.

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

No branches or pull requests

2 participants