Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I am not sure what technologies you are using or what you have already tried, but all you should need to do is apply a force* along the ship object's forward axis, i.e. the vector that corresponds to the ship's facing.  So for example, if the ship's positive Z axis points in the direction of travel, you would direct its movement along the positive Z axis (relative to the ship, not the world space).  Meanwhile, steering would just rotate the ship along its vertical axis without applying a directional force.  This would mean that regardless of how the ship is rotated, it will always continue moving along its own forward axis.

I am not an expert in nautical physics, so you may be trying to do something more complicated, but this should handle the basic case.

* Substitute translation, acceleration, etc. for whatever method you're using to calculate movement.

Thanks, it helped me with the problem! But now my player is not staying still on the ground. And also when I move, it kind of lags and does show a snappy movement, even though I am using a fixed update.

It sounds like you need to apply gravity to the ship and/or increase its mass.  Or, if the ship never needs to move up and down at all, you could just reset its Y position every frame.

As for jittery movement, if you are applying a force or some other physics function, you should do it in FixedUpdate.  If you are applying a regular translation or rotation or doing anything else, you should do it in Update.