You know how a 2D vector [x,y] is just how far you go left/right and up/down? a 3d vector [x,y,z] exactly the same but you’ve also got an additional number for how far up and down you go.
Unities Vector3 is the same, but maybe you’re not quite used to the order. A vector3 is a vector composed of [x,y,z], where x is “left/right”, y is “up/down”, and z is “backwards/forwards”.
So let’s say you want to move something up four units, and two units to the right. That would be Vector3(2,-4,0): Move right 2, up 4, forwards 0.
A vector3 is 3 floating point numbers one for x, y and z and gives you a point in space. If you have 2 of them, you can draw a line between point 1 and point 2, if you make an object follow that line over a set period of time you can make it move.
The vector3 can help give you an arrow, and the length of the arrow is the velocity of the vector.
The difference between 2D and 3D is that in 2D you only have 1 plane that an object can move on, in 3D there are 2 more planes at 90 degree angles to the others.
Latest Answers