Difference between revisions of "FindRandomActorFromRef - Game"
Jump to navigation
Jump to search
imported>Thingy Person (→Syntax) |
imported>Chesko (Removed confusing return function from syntax, as other functions on this wiki do not follow that format.) |
||
Line 8: | Line 8: | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
Actor Function FindRandomActorFromRef(ObjectReference arCenter, float afRadius) global | Actor Function FindRandomActorFromRef(ObjectReference arCenter, float afRadius) global | ||
</source> | </source> | ||
Latest revision as of 07:55, 13 January 2014
Member of: Game Script
Finds a random actor within a given radius of a reference.
Syntax[edit | edit source]
Actor Function FindRandomActorFromRef(ObjectReference arCenter, float afRadius) global
Parameters[edit | edit source]
- arCenter: The reference to search around
- afRadius: Maximum distance from center to look for an actor
Return Value[edit | edit source]
A random actor found, none if no actor in the area.
Examples[edit | edit source]
; Find a random actor near the player, limiting the search to 5 units
Actor randomActor = Game.FindRandomActorFromRef(Game.GetPlayer(), 5.0)