Soldier.getUniqueId 117
Get unique identifier for the unit. This is useful to check if a unit already exist, or to find specific units with findSoldier, especially across the network or between different phases.
Return value
| Return Type | Description |
|---|---|
| integer | A unique ID for the unit, Nil if not found. |
No parameters defined for this function.
Examples
Example 170
-- Spawn a soldier
local soldier = spawnSoldier(vec3(10, 1.5, 10), "Germany_axis", 8, "ger_infantry_tankcrew_leader")
-- Acquire the unique id of the spawned soldier
local soldierUniqueId = soldier.getUniqueId()