Difference between revisions of "FindRandomActor - Game"
Jump to navigation
Jump to search
imported>Vitamant m (1 revision: Clobber re-import by Henning) |
imported>Scrivener07 |
||
Line 24: | Line 24: | ||
Actor randomActor = Game.FindRandomActor(0.0, 0.0, 0.0, 5.0) | Actor randomActor = Game.FindRandomActor(0.0, 0.0, 0.0, 5.0) | ||
</source> | </source> | ||
== Notes == | |||
* Can use the position, even without offsets, of an actor as the center of the search, the return value will be a random actor. | |||
== See Also == | == See Also == |
Latest revision as of 03:55, 2 September 2021
Member of: Game Script
Finds a random actor within a given radius of a location.
Syntax[edit | edit source]
Actor Function FindRandomActor(float afX, float afY, float afZ, float afRadius) native global
Parameters[edit | edit source]
- afX: center of the search, X component
- afY: center of the search, Y component
- afZ: center of the search, Z component
- afRadius: Maximum distance from center to look for an actor
Return Value[edit | edit source]
A random actor found, none if no actor is within the search position and radius.
Examples[edit | edit source]
; Find a random actor to 0,0,0, limiting the search to 5 units
Actor randomActor = Game.FindRandomActor(0.0, 0.0, 0.0, 5.0)
Notes[edit | edit source]
- Can use the position, even without offsets, of an actor as the center of the search, the return value will be a random actor.