Jump to content

Recommended Posts

Posted (edited)

It can be calculated, provided you have access to the object's orientation subtable along the x axis.

 

local My_Unit = Unit.getByName("name of the unit in ME")

local Unit_Position = My_Unit:getPosition()

Heading_radians = math.atan2( Unit_Position.x.z, Unit_Position.x.x )
 
 if Heading_radians < 0 then
    Heading_radians = Heading_radians + 2 * math.pi
 end

local Heading_degrees = Heading_radians * 180 / math.pi [color="Blue"]-- Unit's heading in degrees[/color]

 

 

Alternatively, you can use the MOOSE method :GetHeading(), which runs the code I posted above, pretty much.

Edited by Hardcard
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...