Hi!
I am in the part where we need to rotate the rocket using Vector3.forward on the A key. Why does forward go to the “left” and why is it also on the Z axis?
Hi!
I am in the part where we need to rotate the rocket using Vector3.forward on the A key. Why does forward go to the “left” and why is it also on the Z axis?
In Unity, the forward
axis of a 3D vector is the Z-Axis. Vector3.forward
is just a shortcut for Vector3(0, 0, 1)
which is 0 on the X-Axis, 0 on the Y-Axis and 1 on the Z-Axis. You should be able to see this in your IDE tooltip if you just hover over the forward
.
In Project Boost, if you followed the course, the Z-Axis is the axis pointing away from the camera (your own ‘forward’ as you look at the screen). Rotating on the Z-Axis would be the same as taking a piece of wood (your rocket) and nailing it to the wall (the nail being the Z-Axis). When you rotate the wood, it rotates around the nail which is what’s happening in this section.
Thanks! Yeah I get it now. It rotates on its Z axis.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.