How do you change your z axis in a movement script.

So im trying to make a C# script for a 2d game.

if(Input.GetKey (KeyKode.D))
transform.Translate(Vector2.Right x 8f x Time.Deltatime);
transform.eulerAngles (x, y how do i make a rotation for z when pressing D? if I typ (0, 0, 90) I just get errors.

The player in this top view game starts moving upwards when pressing S and D/A. I thought if you make the ship rotate 90° to the left/right when pressing a/d this problem world go away.

Im very new to scripts sorry if this question is dumb. ty

Well, it’s because you’re new to coding. Look at the API.

This is the correct way to use it:

transform.eulerAngles = new Vector3(0, 0, 90);