Global/VectorRand

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Min/max args)
Line 2: Line 2:
 
|Name=VectorRand
 
|Name=VectorRand
 
|Parent=Global
 
|Parent=Global
|Description=Returns a random vector whose components are each between -1 and 1
+
|Description=Returns a random vector whose components are each between min and max.
 
|Realm=Shared and Menu
 
|Realm=Shared and Menu
 
|IsClass=No
 
|IsClass=No
 
|File=lua/includes/util.lua
 
|File=lua/includes/util.lua
 
|Line=97-L99
 
|Line=97-L99
 +
}}
 +
{{Arg
 +
|type=number
 +
|name=min
 +
|default=-1
 +
|desc=Min bound inclusive.
 +
 +
{{NextUpdate}}
 +
}}
 +
{{Arg
 +
|type=number
 +
|name=max
 +
|default=1
 +
|desc=Max bound exclusive.
 +
 +
{{NextUpdate}}
 
}}
 
}}
 
{{Ret
 
{{Ret
 
|type=Vector
 
|type=Vector
|desc=The random direction vector
+
|desc=The random direction vector.
 
}}
 
}}

Revision as of 19:56, 5 June 2019

 VectorRand( )

Contents

Description

Returns a random vector whose components are each between min and max.

Arguments

number min=-1

Min bound inclusive.


Next Update Change

This feature is only available in the next update.

Arguments

number max=1

Max bound exclusive.


Next Update Change

This feature is only available in the next update.

Returns

Vector

The random direction vector.
Personal tools
Navigation