DCS func destroy

From DCS World Wiki - Hoggitworld.com
Revision as of 00:12, 12 April 2018 by Grimes (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Scripting Root

Envrioment: Mission Scripting
Function: destroy Added with: 1.2.0
Member Of: Object, Group, Spot
Syntax: function Object.destroy(Class Self )
Description: Destroys the object, physically removing it from the game world without creating an event. The object simply disappears. If used with a group, the entire group will be destroyed.

Function also works with Unit, Weapon, Static Object, Scenery Object, Airbase


Return Value: function
Return Example: none
Examples: If there is a unit in a mission with a name of "bob" it will be destroyed
Unit.getByName('bob'):destroy()

Destroys the group "tanks"

local myGroup = Group.getByName('tanks')
Group.destroy(myGroup)
Related Functions: Object Functions: isExist, destroy, getCategory, getTypeName, getDesc, hasAttribute, getName, getPoint, getPosition, getVelocity, inAir
Notes: Cannot be used on client aircraft in multiplayer

Due to a bug, this function does not currently work on scenery objects (dcs 1.2.14)