Background for Fallout 4
Member of the Game script
ObjectReferencefunctionFindClosestReferenceOfType(FormarBaseObject, floatafX, floatafY, floatafZ, floatafRadius)NativeGlobal

Description

Wiki Description

Finds the closest ObjectReference of the given type from the given location and within the given radius.

Documentation Comment

Finds the closest reference of a given base object within a given radius of a location


Caveats


Parameters

FormarBaseObject

CK Wiki Description

The type of base object to look for

floatafX

CK Wiki Description

center of the search, X component

floatafY

CK Wiki Description

center of the search, Y component

floatafZ

CK Wiki Description

center of the search, Z component

floatafRadius

CK Wiki Description

Maximum distance from center to look for a ObjectReference


Examples

; 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)

Auto-Generated Example

Form myForm__arBaseObject
float myFloat__afX
float myFloat__afY
float myFloat__afZ
float myFloat__afRadius

ObjectReference returnedValue = Game.FindClosestReferenceOfType(myForm__arBaseObject, myFloat__afX, myFloat__afY, myFloat__afZ, 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.