Difference between revisions of "DCS func getUnit"

From DCS World Wiki - Hoggitworld.com
m (1 revision imported)
 
Line 19: Line 19:
 
|rtnExample= any positive number
 
|rtnExample= any positive number
  
|reqType1= number
+
|reqType1= Class
  
|reqName1= unitIndex
+
|reqName1= self
  
|reqType2=  
+
|reqType2= number
  
|reqName2=
+
|reqName2= UnitIndex
 +
 
 +
|reqType3=
  
 
|optType1=
 
|optType1=

Revision as of 03:58, 6 April 2021

Scripting Root

Envrioment: Mission Scripting
Function: getUnit Added with: 1.2.0
Member Of: Group
Syntax: Unit Group.getUnit(Class self , number UnitIndex )
Description: Returns the unit object of the specified unitIndex within the group. If the index is not valid, this function will return nil.


Return Value: Unit
Return Example: any positive number
Examples: Returns the first unit in a group
local unit1 = Group.getByName('tanks'):getUnit(1)
Related Functions: Group Functions: isExist, activate, destroy, getCategory, getCoalition, getName, getID, getUnit, getUnits, getSize, getInitialSize, getController, enableEmission
Notes: