ObjectReferencefunctionFindClosestReferenceOfTypeFromRef(FormarBaseObject, ObjectReferencearCenter, floatafRadius)Global
Description
Wiki Description
Finds the closest ObjectReference of the given type from the location of 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
CK Wiki - Notes
- if arBaseObject is the same type as arCenter, this function will return arCenter instead. In other words arCenter is not excluded from the the search.
Parameters
Examples
; Find the closest diamond reference to the player, limiting the search to 5 units
ObjectReference closestDiamond = Game.FindClosestReferenceOfTypeFromRef(Diamond, Game.GetPlayer(), 5.0)Auto-Generated Example
Form myForm__arBaseObject
ObjectReference myObjectReference__arCenter
float myFloat__afRadius
ObjectReference returnedValue = Game.FindClosestReferenceOfTypeFromRef(myForm__arBaseObject, myObjectReference__arCenter, myFloat__afRadius)Related Pages
- Game
- Game.FindClosestReferenceOfAnyTypeInList(...)
- Game.FindClosestReferenceOfAnyTypeInListFromRef(...)
- Game.FindClosestReferenceOfType(...)
- Game.FindRandomReferenceOfAnyTypeInList(...)
- Game.FindRandomReferenceOfAnyTypeInListFromRef(...)
- Game.FindRandomReferenceOfType(...)
- Game.FindRandomReferenceOfTypeFromRef(...)
Additional References
View this function’s page on the Fallout 4 Creation Kit Wiki
