Global/VectorRand

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
{{Function
+
{{Func
| Name = VectorRand
+
|Name=VectorRand
| Namespace = [[Global]]
+
|Parent=Global
| Realm = Shared
+
|Description=Returns a random vector whose components are each between -1 and 1
| Origin = Lua
+
|Realm=Shared
 +
|IsClass=No
 
}}
 
}}
 
{{Syntax
 
| Name = VectorRand
 
| Description = Returns a random vector whose components are each between -1 and 1
 
| 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==
 
* This will not return unit vectors (Vectors with length = 1), use {{ClassFunction|Vector|GetNormal}} on this
 

Revision as of 16:24, 26 February 2013

 VectorRand( )

Description

Returns a random vector whose components are each between -1 and 1

Personal tools
Navigation