Difference between revisions of "FindClosestActorFromRef - 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 23: Line 23:
</source>
</source>


== Notes ==
* As with the Skyrim counterpart, if an actor is used for arCenter, the return value will be that of arCenter. The example above was not tested by whoever put that there.
== See Also ==
== See Also ==
*[[Game Script]]
*[[Game Script]]

Latest revision as of 02:52, 2 September 2021

Member of: Game Script

Finds the closest actor within a given radius of a reference.

Syntax[edit | edit source]

Actor Function FindClosestActorFromRef(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]

The closest actor found, none if none.

Examples[edit | edit source]

; Find the closest actor to the player, limiting the search to 5 units
Actor closest = Game.FindClosestActorFromRef(Game.GetPlayer(), 5.0)

Notes[edit | edit source]

  • As with the Skyrim counterpart, if an actor is used for arCenter, the return value will be that of arCenter. The example above was not tested by whoever put that there.

See Also[edit | edit source]