Obtaining Vectors
There are different ways to obtain a vector.
First is by using the toVector method on a location. This will use the coordinates from that location and form a vector with the values. Second is the getDirection method on a location as well. This one is a bit more abstract because not every location always has a meaningful direction. For example the location of a block in a world doesn't have any direction. Instead locations obtained from entities (like players) contain information where the player is looking at. A direction vector will always be a unit-vector.

Please note that this is purely for a visual sake. As explained on the previous page, the orange direction vector actually sits at the origin.
Also note that the point where the 3 axes meet is not actually the origin in the world. It's an artifical origin to illustrate the point.
Third is creating vectors yourself. Sometimes you need to create vectors yourself as well.
You can also obtain a vector through the getVelocity method. In the context of this tutorial this is not what you want.
Last updated