Is there a way to fix the problem shown in this lecture around 9:40? I’ve been having the same problem where if my rocket hits the side of an object while it’s rotating, that it’ll get moved and then fall over on its face or something. Does this problem get fixed later on?
I think this happens because setting RigidBody.freezeRotation actually sets the constraints. So when we do rigidbody.freezeRotation = false; in the end, we actually remove the constraints on X and Y we had set on the rocket. You can verify this by adding Debug.Log(rigidbody.constraints); before and after setting freezeRotation, e.g.
My solution is to simply set RigidBody.constraints directly instead of indirectly through RigidBody.freezeRotation. The Unity document is lacking a bit on this, but basically doing
There was also a problem in the adding tags episode, as the constraints disappeared when the mass was changed, together with the drag setting. It seems Unity have fixed this action in later releases and changing the mass does not lose other rigidbody settings.
Setting the constraints as @parmus did is a good option.