Rigidbody.AddForce manipulating frozen rotation values

I have a spaceship in which I have locked certain values in its Rigidbody:
3600811--292316--upload_2018-8-17_11-15-36.png
Every frame, I use Rigidbody.AddForce to move the spaceship forward when its boosters are activated. As such:

if (Input.GetKey(throttleKey))
{
    rb.AddForce(-transform.up * 25);
}

However, the spaceship starts rotating in the X and Y directions. Does anyone know why?

Also, the position got pretty screwed up as well (it was flying over objects that it was supposed to collide with):
3600824--292318--upload_2018-8-17_11-24-28.png
Compared with how the Transform was at the start:
3600824--292319--upload_2018-8-17_11-25-32.png
This is getting quite frustrating. :rage:

Perhaps you want to apply relative force instead.

No, relative force doesn’t work for me. :slight_smile: That screws up my entire movement system, which requires -transform.up to function. Not using AddForce and using AddRelativeForce instead makes the ship always move down, no matter what its rotation is.

I managed to get a workaround for this problem by using a box collider instead for the spaceship, but it would still be nice to use a mesh collider. :frowning: No rotational problems when colliding with objects anymore! :smile:

Seams you got something wrong there in your script. Type of collider is irrelevant, to what Rigid Body does. Other than collision detection and applying forces when that happens. Double check your logic. Is typically problem there. AddRelativeForce does work. Appears your force vector has incorrect value.