# In Unity, is there a difference between Vector3.down and -Vector3.up?

I've noticed numerous tutorials and examples using something like "transform.up * -1" or "-Vector3.up" instead of simply saying "transform.down" and "Vector3.down".

Is there a good reason for this, or is it simply a style difference?

I'm specifically thinking about downward raycasts, if that matters at all.

• Not really, both cases whether transform (locally) or Vector3 (world) mean the inverse if you change their signs. Although it is better to call for -Vector3.up than (Vector3.up * -1f), because the later needs a multiplication operation. Asides from that, it may be just comodity, pecause it is easier to change code, than to change "up" for "down", for example. – LifGwaethrakindo Mar 19 '18 at 20:29
• Note that while Vector3.down exists, transform.down does not. (At least, not according to the docs as of version 2017.3) – DMGregory Mar 19 '18 at 22:26

They're equivalent. You can verify via the documentation for down and up respectively.

The choice is thus down to style (or perhaps ignorance of the existence of down) and relatively minor, nitpicky sorts of details (like how one could make that case that, for iteration purposes, it may be easier to add or remove the leading - to switch between two options).

Vector3.up equals to new Vector3(0, 1, 0)

Vector3.down equals to new Vector3(0, -1, 0)

When you do -Vector3.up it sets every value to negative value:

public static Vector3 operator -(Vector3 vector)
{
vector.x = -vector.x;
vector.y = -vector.y;
vector.z = -vector.z;

return vector;
}


Or Unity could also implement it as immutable type and it will do:

public static Vector3 operator -(Vector3 vector)
{
return new Vector3(-vector.x, -vector.y, -vector.z);
}


Though, you can do someVector.y = 10f;, thus they are not immutable.