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

Setting XPBD Gravity resource to 0 and my character still falls ? #48

Closed ethereumdegen closed 2 months ago

ethereumdegen commented 4 months ago

Setting XPBD Gravity resource to 0 and my character still falls ?

idanarye commented 4 months ago

There are several things in Tuna that can generate downward acceleration/impulses even when you set the gravity to 0, but if I had to guess - I'd say it's free_fall_extra_gravity. Try setting it to 0 (at least when you disable gravity)

Also, if you are using TnuaBuiltinJump, notice that it also has several fields that end with _extra_gravity, so maybe you'll have to zero them as well.

ethereumdegen commented 2 months ago

i fixed this for now by pausing physics time when i need to prevent falling (like when world is loading)

ethereumdegen commented 2 months ago

BUT it would be cool to have a 'flying' builtin