ObjectReferencefunctionFindClosestReferenceOfAnyTypeInListFromRef(FormListarBaseObjects, ObjectReferencearCenter, floatafRadius)Global
Description
Wiki Description
Finds the closest ObjectReference of any of the types in the list around the target ObjectReference and within the given radius.
Documentation Comment
Finds the closest reference of a given base object within a given radius of a reference
Caveats
Parameters
ObjectReferencearCenter
CK Wiki Description
The ObjectReference to use as the center point of the search
floatafRadius
CK Wiki Description
Maximum distance from center to look for a reference
Examples
; Find the closest gem reference to the player, limiting the search to 5 units
ObjectReference closestGem = Game.FindClosestReferenceOfAnyTypeInListFromRef(GemList, Game.GetPlayer(), 5.0)Auto-Generated Example
FormList myFormList__arBaseObjects
ObjectReference myObjectReference__arCenter
float myFloat__afRadius
ObjectReference returnedValue = Game.FindClosestReferenceOfAnyTypeInListFromRef(myFormList__arBaseObjects, myObjectReference__arCenter, myFloat__afRadius)Related Pages
- Game
- Game.FindClosestReferenceOfAnyTypeInList(...)
- Game.FindClosestReferenceOfType(...)
- Game.FindClosestReferenceOfTypeFromRef(...)
- Game.FindRandomReferenceOfAnyTypeInList(...)
- Game.FindRandomReferenceOfAnyTypeInListFromRef(...)
- Game.FindRandomReferenceOfType(...)
- Game.FindRandomReferenceOfTypeFromRef(...)
Additional References
View this function’s page on the Fallout 4 Creation Kit Wiki
