FindClosestReferenceOfType - Game
Member of: Game Script
Finds the closest reference of the given type from the given location and within the given radius.
SyntaxEdit
ObjectReference Function FindClosestReferenceOfType(Form arBaseObject, float afX, float afY, float afZ, \
float afRadius) native global
ParametersEdit
- arBaseObject: The type of base object to look for
- afX: center of the search, X component
- afY: center of the search, Y component
- afZ: center of the search, Z component
- afRadius: Maximum distance from center to look for a reference
Return ValueEdit
The closest reference found, none if none.
ExamplesEdit
; Find the closest diamond reference to 0,0,0, limiting the search to 5 units
ObjectReference closestDiamond = Game.FindClosestReferenceOfType(Diamond, 0.0, 0.0, 0.0, 5.0)
See AlsoEdit
- Game Script
- FindClosestReferenceOfAnyTypeInList - Game
- FindClosestReferenceOfAnyTypeInListFromRef - Game
- FindClosestReferenceOfTypeFromRef - Game
- FindRandomReferenceOfAnyTypeInList - Game
- FindRandomReferenceOfAnyTypeInListFromRef - Game
- FindRandomReferenceOfType - Game
- FindRandomReferenceOfTypeFromRef - Game