Name two options to move an Object on the z axis?
transform.Translate(0, 0, 1);
or
transform.Translate(Vector3.forward);
How do you move an Object on the z axis?
How do you move an Object along the x-axis?
How do you move an object forward?
Explain what the following code does:
The code changes (translates) the position (transform) in a direction 3D-Space (Vector3) on the z-axis (forward).
How do you get the 3D-location of an object?
What is the moveSpeed variable doing to the GameObject in this scenario?
It multiplies the forward movement by the value of the moveSpeed variable.
Vector3.forward is the same as (0,0,1), meaning each axis is multiplied by the moveSpeed variable.
Since x and y are both 0, only the z-variable is affected.
Last changed18 days ago