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

3d example stuck #27

Closed dt665m closed 11 months ago

dt665m commented 11 months ago

if you crouch under one of the platforms and lets it auto hold crouching... you get stuck if you jump. Great work on the library! Looking through it for inspiration but if I find any obvious reason why this happens I'll try to PR. Cheers!

idanarye commented 11 months ago

I assume you mean this?

https://github.com/idanarye/bevy-tnua/assets/1149255/0d61cdf8-0ec3-4af7-9124-0f6240e53df6

Happens with the 2D example too, but because the physics configuration there is "softer" you can wriggle your way out of it:

https://github.com/idanarye/bevy-tnua/assets/1149255/d9bbd827-f404-465e-a39e-dd1a9aac1d86

dt665m commented 11 months ago

Yeah, I'm not sure if this is just the example's setup or if there is something going on in the platformer system. It's quite a bit of code. Just mentioning here that I ran into it.

idanarye commented 11 months ago

Without TnuaKeepCrouchingBelowObstacles, you'd get a similar behavior when releasing the crouch button while still under the obstacle. So I suspect it's a similar issue.

Another option to investigate is that the character does not go high enough for Tnua to detect that the jump has already started, and it thinks that it's still in the jump takeoff stage.

idanarye commented 11 months ago

Note that the fix uses TnuaKeepCrouchingBelowObstacles - you'd still get stuck if you don't use it.