Open qhdwight opened 1 year ago
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!
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.
Starting some work on the rapier-character-controller
branch
Thanks for reminding me! Ill commit my changes to that branch sometime today!
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.
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.
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.
https://rapier.rs/docs/user_guides/bevy_plugin/character_controller/