Difference between revisions of "FindRandomActorFromRef - Game"

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search
imported>Vitamant
m (1 revision: Clobber re-import by Henning)
 
imported>Scrivener07
 
Line 22: Line 22:
Actor randomActor = Game.FindRandomActorFromRef(Game.GetPlayer(), 5.0)
Actor randomActor = Game.FindRandomActorFromRef(Game.GetPlayer(), 5.0)
</source>
</source>
 
== Notes ==
* arCenter is not included in the search and the return value will be a random actor.
== See Also ==
== See Also ==
*[[Game Script]]
*[[Game Script]]

Latest revision as of 03:49, 2 September 2021

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)

Notes[edit | edit source]

  • arCenter is not included in the search and the return value will be a random actor.

See Also[edit | edit source]