Difference between revisions of "DCS func getPosition"
From DCS World Wiki - Hoggitworld.com
m (1 revision imported) |
|||
Line 40: | Line 40: | ||
[[DCS_Class_Object|'''Object Functions:''']] {{listofScriptingObjectFuncs}} | [[DCS_Class_Object|'''Object Functions:''']] {{listofScriptingObjectFuncs}} | ||
− | |examples= | + | |examples= Assigns a value for the heading and pitch of the unit. |
+ | |||
+ | local unit = Unit.getByName('Bob') | ||
+ | local unitpos = unit:getPosition() | ||
+ | local Heading = math.atan2(unitpos.x.z, unitpos.x.x) | ||
+ | local Pitch = math.asin(unitpos.x.y) | ||
|notes= | |notes= | ||
}} | }} | ||
[[Category:Class Functions|getPosition]] | [[Category:Class Functions|getPosition]] |