get Orientation

Get the orientation in degrees of the Agent.

agent.getOrientation()

The orientation is the heading of the Agent in degrees. The heading is the direction in which the Agent is facing. The degree values range from 0 to 179.9, or South to West to North, until becoming -180.0 for due North. Similarly, degree values range from 0 to -180.0, or South to East to North but the values are negative. This means that while the heading has some Eastward direction, the value will be negative and with some Westward direction, it’s positive. Due East is -90.0 and due West is 90.0.

Returns

  • a number which is the orientation of the Agent in degrees.

Example

Display the Agent’s current heading (orientation) in degrees.

player.onChat("agentheading", function () {
    player.say("My Agent's orientation is: " + agent.getOrientation())
})

See also

get position