Sphere flying with AddForce, with no rotation

alt text

Here’s my flying sphere.
I need to instantiate all those little blue baby-spheres right under it, while it’s flying.
It’s kinda hard to do, since the sphere is rotating during the flight.

Is there any chance I can make it fly without any rotation, still using AddForce?

In the inspector panel under the rigidbody component look for constraints. Expand it if it isn’t already and check X, Y and Z under constraints and try your code. That should do the trick. If you need to do it in code and not in the inspector use this:

rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ;

if you need to turn them off in code you can do this:

rigidbody.constraints = RigidbodyConstraints.None;