Convert EulerAngle.z into Vector 3

My script currently gets the local Euler Angle of a game object, and i need to convert that into a vector 3.
Funny thing is, this math worked on a completely separate demo, but now i am getting funny results in a new project.

If i use this script on an object set to 0 degrees, it moves correctly. If i change it by 90 degrees, it moves at 180 degrees instead of 90.
I have tried some of the other functions unity has for moving towards an angle, but i can never get them to work.

    float moveDirection = gameObject.transform.localEulerAngles.z; 
	Debug.Log ("movement direction is" + moveDirection);
	float moveSpeed = spawnerMoveSpeed; 
	Debug.Log ("movement speed is" + moveSpeed);
	
	float xMove = Mathf.Cos (Mathf.Deg2Rad * moveDirection);
	float yMove = Mathf.Sin (Mathf.Deg2Rad * moveDirection);
			
	Vector3 thatWay = new Vector3 (xMove, yMove, 0);
	transform.Translate (thatWay * moveSpeed * Time.deltaTime);

Translate assumes local space by default, thus the angle you’ve calculated is added to the current rotation. Define Space.World in Translate and this problem will probably be solved:

transform.Translate (thatWay * moveSpeed * Time.deltaTime, Space.World);

But all this math is unnecessary: you can replace the whole code with a simple Translate instruction exactly because it works in local space by default!

If your object’s front side points in its X local axis, delete all this code and do it with a single line:

transform.Translate(moveSpeed * Time.deltaTime, 0, 0);

If the object’s forward direction is its local Y, however, use this:

transform.Translate(0, moveSpeed * Time.deltaTime, 0);

NOTE: Reading eulerAngles is always a bad idea: the values returned may jump suddenly to very weird XYZ combinations, specially when crossing multiples of 90 degrees in any axis.