DestroyNearestObjectByTag(string, object, float)
Destroy the nearest object in the source's area by tag.
The tag you are interested in.
An object in the area you are interested in. (Default: OBJECT_SELF)
Delay (in seconds) before object is destroyed. (Default: 0.1)
Destroys the nearest object in oSource's area whose tag matches sTag.
This is a wrapper for DestroyObject.
oSource should not be an area, it should be an object IN the area you are interested in. It might actually still work if oSource is an area but that isn't what the intent of the function is.
This uses GetNearestObjectByTag to locate the closest object with sTag to oSource. Given how GetNearestObjectByTag works, it will not search for a match outside of the area that oSource is in.
|functions:||DestroyObject | GetNearestObjectByTag|