Vertical & horizontal movement world axis (top view)

Does anyone know how to script horizontal and vertical movement only in the world axis so my player can turn freely and their local direction doesnt effect the way forward left right is, my game is top view.


how to move in world axis in c#

transform.Translate(new Vector3(

if you don't specify Space.World it assumes you want to move on the transforms local axis.

Note: You said top view so I assumed you wanted to move on x and z axis, if you want to move on x and y, just switch the 2nd and 3rd arguments on the Translate function I provided.