idanarye / bevy-tnua

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

It's possible to get stuck falling #2

Closed janhohenheim closed 1 year ago

janhohenheim commented 1 year ago

image Repro steps:

While holding left, the character will be stuck in the air doing their falling animation in place.

idanarye commented 1 year ago

So, the actual problem here is that Tnua casts a ray to judge the proximity to the ground. When you are on the edge, the ray does not it the obstacle but the collider does.

One way to fix this is by casting a shape instead of a ray. The example allows it with the Sensor Shape option: image

I'm not sure if this needs to be enforced though, or just better documented.

janhohenheim commented 1 year ago

Better documentation seems like the right approach to me, the raycast should surely suffice for many users