idanarye / bevy-tnua

A floating character controller for Bevy
https://crates.io/crates/bevy-tnua
Apache License 2.0
235 stars 16 forks source link

The raycast direction pointing downward is modified when rotating the collider making implementing an FPS trickier #50

Closed ramirezmike closed 7 months ago

ramirezmike commented 7 months ago

While using bevy-tnua to create an FPS controller if I looked up or down, the controller would fall.

Here's an example of the problem viewed from the side

https://github.com/idanarye/bevy-tnua/assets/1421719/12735ae3-9191-4d5b-bd04-a3373d09eeae

As the controller tilts, it falls since the raycast is pointing down relative to the transform instead of -Vec3::Y or maybe the direction of gravity?

In the meantime, I think a workaround would be to put the camera as a child of the controller.