- Home /
Question by
prodanov51 · Apr 17, 2020 at 09:19 AM ·
2d2d-platformerrotations
Limit rotation when using AddTorque in Unity 2d,How can I limit the rotation when using Rigidbody2D.AddTorque?
I'm trying to tilt my player (box) when falling down, but it ends up spinning out of control. Here are the few lines of code that I have.
if (isFalling)
{
rb.AddTorque(-0.02f, ForceMode2D.Impulse);
}
But I'm not trying to limit the overall rotation of the box, only when it is falling. Thanks in advance.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612231610im_/https://answers.unity.com/themes/thub/images/avi.jpg)