c# – Unity AddTorque affecting more axes than it should
I’ve tried flipping this problem upside down and however I can, but I still can’t figure it out. I have a cube with a box collider to which I have attached a Rigidbody and a Configurable Joint to constrain the X rotation to -75/75 and the Z rotation to -30/30.
When running the above code, the Z axis of my cube is being modified every fixedupdate. It’s also being modified beyond the constraint. My debug showed me that angular momentum is being applied to the Z axis (see debug console). I’ve tried every force mode to see if I could get any other results but so far no luck.
Ideally, the AddTorque should only affect the X and Y axis. Why is this not the case? How can I cancel out (or just not have) any angular rotation on the Z axis (without locking it off)?
There is very little documentation on this problem online. I’d really appreciate if someone could help me advance here as I have been on this problem for over 40h now…
Read more here: Source link

