What is the meaning of Vector3.back?

What is the meaning of Vector3.back?

It is shorthand for writing Vector3(0,0,-1)

There is no such command. Try instead -Vector3.forward. :wink:

Vector3.forward gives you a unit vector pointing along the z axis, or (0,0,1).

Vector3.back gives you the opposite, (0,0,-1).

Neither of these are necessarily useful on their own, but they can be very useful in tandem with other code.

Some simple examples:

//pos points 1,000 units down the z axis
pos = Vector3.forward * 1000f;

//bar equals foo with zeroed x and y components
bar = Vector3.Scale(foo, Vector3.forward);

//baz points down the z axis with length equal to foo's
baz = Vector3.forward * foo.magnitude;

Those examples don’t necessarily make sense out of context, unfortunately. The more you know about vector math, the more apparent the utility of these values should be.

Remember that vectors express a direction and length. A unit vector, with length one, can be thought of as expressing a pure direction. That’s very useful in game development.