player rotation not affecting movement direction

Hello im rather new to unity im trying to make a simple flying race game and i want my player objects to move in there z axis rather than the global z axis.

because my player needs to be able to move in the direction its facing im having an issue where it is looking backwards but moving on the global z axis not matter where its facing.

is there some hidden drop down button that switches an objects transform to local rather than global?

Thanks in advance

Generally, when you’re having problems with code, you should post the related code so we can see what’s wrong. Without it, we’re just guessing, but here’s my best guess:

Positions in games are generally stored in world coordinates (the exception being a child of a non-identity transform), and regardless of whether it is, the transform.position will always show world coordinates.

So, when you move it on the z-axis, that’s either the world’s z-axis or the parent object’s if you are modifying localPosition.

What you want to do, rather than adding like this (which uses world-forward):

transform.position += Vector3.forward;

Is instead add code that uses the object’s transform’s forward like this:

transform.position += transform.forward;