Rotation constraints bug resolved

I hope this information will be helpful to somebody.

There is a small bug in freeze rotation logic.

In the original code, we use simple rigidBody.freezeRotation. The problem is that this option work with all rotation constraints simultaneously and then you make it false. X and Y constraints eventually become false. As a result, sometimes a ship can rotate by X and Y.

To solve the problem I’ve written a simple method which replaced rigidBody.freezeRotation.

Pastebin with code.

Eventually, my rotation code looks like this.

1 Like

Late answer but you are true indeed.

1 Like

Privacy & Terms