Background for Fallout 4
Member of the Game script
ActorfunctionFindClosestActorFromRef(ObjectReferencearCenter, floatafRadius)Global

Description

Wiki Description

Finds the closest Actor within a given radius of a ObjectReference.

Documentation Comment

Finds the closest actor within a given radius of a reference


Caveats

CK Wiki - 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.

Parameters

ObjectReferencearCenter

CK Wiki Description

The ObjectReference to search around

floatafRadius

CK Wiki Description

Maximum distance from center to look for an Actor


Examples

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

Auto-Generated Example

ObjectReference myObjectReference__arCenter
float myFloat__afRadius

Actor returnedValue = Game.FindClosestActorFromRef(myObjectReference__arCenter, myFloat__afRadius)

Related Pages


Additional References

View this function’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.