Replies: 1 comment
-
Tnua uses the external forces compnent itself, so whatever solution would need to work. I think maybe a new component -
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently Tnua with the avian3d backend uses the gravity resource from Avian implicitly. Changing the gravity resource dynamically can allow for some interesting results:
The drawback is that since gravity direction is a resource in avian, it is global, so gravity direction changes applied to the character apply to all objects. For some of the cases listed above, this is a complication.
A workaround is to disable gravity in avian for other rigid bodies and make gravity manually using ExternalForce. (Gravity in avian can be scaled per-object but not redirected). But thinking about Server-Authoritative multiplayer and server-side prediction, I think multiple controllers will need to be present in the same ECS World on the server to predict multiple players' movements seamlessly? Is that correct? In this case, the solution will not work.
Ultimately, I've failed to hack gravity for the Tnua controller in Avian. Applying a force will not change how Tnua views up internally.
Edit: It is probably possible to change gravity for each TnuaController directly in the TnuaRigidBodyTracker immediately after the Sensors stage of the pipeline. I will try this next.
Beta Was this translation helpful? Give feedback.
All reactions