Rocket Constraits untick

Hello @ben,

I have noticed that for this part of the code:

private void RotateManually(float rotationThisFrame) { rigidBody.freezeRotation = true; // take manual control of rotation transform.Rotate(Vector3.forward * rotationThisFrame); rigidBody.freezeRotation = false; // resume physics control of rotation }
As soon as i enter play mode, the “Freeze Rotation” constraits will untick, and if the rocket will collide will spin like crazy.

Do you have any idea what would fix this?

Thank you! :slight_smile:

Hi Mihai,

Unfortunately, Ben’s solution did not work as expected. For this reason, he introduces a new one in lecture “Spit & Polish” (currently #71). The fix is very simple. Remove the freezeRotation lines. Then add the following line at the top of your rotation part: rigidBody.angularVelocity = Vector3.zero;.

2 Likes

Indeed, now it works as it should, thank you for the solution. :slight_smile:

You’re welcome. :slight_smile:


See also:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms