# Global/VectorRand

From Garry's Mod

(Difference between revisions)

m (Origin.) |
|||

Line 11: | Line 11: | ||

| Returns = {{Return|Vector|randVec}} | | Returns = {{Return|Vector|randVec}} | ||

}} | }} | ||

− | + | ==Definition== | |

− | == | + | <pre>return Vector( math.Rand(-1.0, 1.0), math.Rand(-1.0, 1.0), math.Rand(-1.0, 1.0) )</pre> |

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

− | + | ||

==Additional Notes== | ==Additional Notes== | ||

− | * This will not return unit vectors (Vectors with length = 1) | + | * This will not return unit vectors (Vectors with length = 1), use {{ClassFunction|Vector|GetNormal}} on this |

## Revision as of 01:45, 24 September 2012

## Definition

return Vector( math.Rand(-1.0, 1.0), math.Rand(-1.0, 1.0), math.Rand(-1.0, 1.0) )