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

Allow toggling Tnua on and off #22

Closed idanarye closed 1 year ago

idanarye commented 1 year ago

We need a new component:

pub struct TnuaToggle(pub bool);

When the boolean is set to false, the character controller will just set the motor to not apply any forces. This will allow the character to be fully controlled by other systems without Tnua interfering. And unlike disabling TnuaSystemSet with a run condition or removing the TnuaMotor (solutions I've suggested for #21) this will not leave leftover ExternalForce for the user to reset.