It’s simple, the torque makes the object rotate in the opposite direction.
I’ve searched through the web, and couldn’t find the answer, as most people apply torque using float.
Here’s the problem. A cube with a rigidbody, no gravity, is in the scene. I added the following simple code.
void Start()
{
gameObject.GetComponent<Rigidbody>().AddTorque(Vector3.up*5);
}
I thought, considering the right-hand rule, the cube would rotate counter-clockwise, looking from the above. However, it rotates clockwise, looked from the above. The same problem occurs using “AddRelativeTorque” as well.
I asked chatGPT and the suggested reason was
- coordinate is upside down, which I don’t think so since I did not touch anything with the world coordinate, and linear force works as expected.
- the asset has reversed coordination, which also is not true since it’s just a vanilla cube.
- unexpected behavior with the engine is my guess. Either a bug, or something unity-specific that I didn’t know.
Thank you in advance, and I’m sorry if this is a duplicate.