Hey everyone, hope you all are doing well.
So I have this simple code:
float rotForce = 40f;
Rigidbody2D rbody2d;
void Start()
{
rbody2d = GetComponent<Rigidbody2D>();
}
void Update()
{
if(Input.GetKeyDown(KeyCode.Space))
{
rbody2d.AddTorque(rotForce);
}
}
When I run the game and press the Space key, the object rotates to the left, and if I use -rotForce, it rotates to the right. This is what confused me. Shouldn’t the opposite be happening? Or am I not getting how the torque is applied?
Can someone help me with this?