- Home /
How do I nullify the torque from colliding but not from player input? (2D,C#)
I think the title explains what i am looking for.
Colliding torque and input torque are separate things, and i do not know how to unite them. For now, i am using:
thisRigidbody.transform.Rotate(0, 0, moveHorizontal*RotV);
for the input rotation.
Thanks for the attention
Since it looks like you are not using a force or torque to induce rotation, can't you simply call that line again OnCollisionExit? (Since your RotV variable will NOT be effected by collisions.)
Answer by FortisVenaliter · May 01, 2016 at 03:47 PM
It depends on if you're trying to do it instantly or over time...
If instantly, then you probably want to disable rotation on the rigidbody entirely, and control the rotation manually through player input. But that could open up other problems. You'll need to play around with the settings and code to get what you want.
If gradually, then you want to apply counter-torque whenever the player is not actively using their controls to change the rotation.