nearestObject: Difference between revisions

From Bohemia Interactive Community
mNo edit summary
m (Fixed params)
Line 16: Line 16:
____________________________________________________________________________________________
____________________________________________________________________________________________


| '''nearestObject''' pos |= Syntax
| '''nearestObject''' [unit,class] |= Syntax


|p1= pos: [[Array]] |= Parameter 1
|p1= unit: [[Object]] |= Parameter 1
 
|p2= class: [[String]] |= Parameter 2


| [[Object]] |= Return value
| [[Object]] |= Return value

Revision as of 09:47, 15 September 2006

Hover & click on the images for description

Description

Description:
Nearest object of given type to given position. For nearestObject pos, pos may be [x, y ,z, "type"] or [object, "type"] or even [x, y, z]. Before ArmA the funcion matched only objects with exactly the type given. Since ArmA, any object derived from the type is found as well.
Groups:
Uncategorised

Syntax

Syntax:
nearestObject [unit,class]
Parameters:
unit: Object
class: String
Return Value:
Object

Examples

Example 1:
_nObject = nearestObject [player, "StreetLamp"]
Example 2:
_nObject = nearestObject [player, "Tank"]

Additional Information

See also:
See also needed

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note

Notes

This command can only find objects up to 50 meters away.

Bottom Section