MIST unitToWP

From DCS World Wiki - Hoggitworld.com


mist.utils.unitToWP

Added with: Mist 4.1
Description
This function takes a unit object or unit name and returns it's current position as a WP table {x, y, alt, alt_type, speed}. alt_type will always be "BARO". Speed is the current units velocity.
Syntax
WP mist.utils.unitToWP(Unit/string unit/unitName )
Valid Input Values:
any unit object or unit name
Return value:
WP
Return example:
{x, y, alt, alt_type, speed}
Usage Examples:

do

local WP = mist.utils.unitToWP('myUnit')
local altMethodWP = mist.utils.unitToWP(Unit.getByName('myUnit'))

end

Notes:
Related Functions
makeVec2, makeVec3, zoneToVec3, makeVec3GL, vecToWP, unitToWP

Scripting Engine

MIST Root Page