How do i keep an object from rotating?

Hello. I am trying to make a space game. I want the game object to rotate with the ship in world space, but NEVER rotate in the local space, on its own. basically, the rotations will always be set to zero in the editor.

1- First make sure you do need a rigidbody on that gameobject. If not, just remove the rigidbody and be done with.

2- If you are going to fully control your rigidbody from code, but need it to affect other gameobjects, make it kinematic (tick the “is kinematic” checkbox on the rigidbody component.

3- If you need your gameobject’s position to be affected by physics, but not it’s rotation, tick those “Freeze rotation” checkboxes on the rigidbody.

So you want to rigidly attached something to the ship? (like a weapon)
Just ensure the root object of the ship has the only rigidbody, children can have colliders, but they must not have rigidbodies.