> For the complete documentation index, see [llms.txt](https://fehdead.gitbook.io/npc-kit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/getrotangzx.md).

# npc.getrotangzx

```lua
npc.getrotangzx()
```

|                         |                                                                           |
| ----------------------- | ------------------------------------------------------------------------- |
| id                      | `0x0070`                                                                  |
| arguments               | 0                                                                         |
| result                  | Float: goes to the very next call, or to `npc.lua(npc.getrotangzx(), fn)` |
| in NPC Kit              | yes                                                                       |
| measured from a kit NPC | returns                                                                   |
| vanilla scripts         | 2297 calls in 195 of 1114 scripts                                         |

## What it does

Gives the NPC's current facing, in radians. A result.

## Result

The heading, a float, as `dir` takes it.

## Timing

Returns at once.

## In NPC Kit

It can feed the next call (`npc.aturn_261(npc.getrotangzx())`) or `npc.lua`, where it arrives cut to an integer: radians lose their fraction, so read it in Lua with care.

## Used with

* [getdestrotangzx\_227](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/getdestrotangzx_227.md): the heading it is set to face.
* [dir](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/dir.md), [aturn\_261](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/aturn_261.md).

## Example

The facing you place the NPC with is known in Lua, so keep it there and turn back to it; read the live facing only to feed the next call.

```lua
local facing = 1.676

init = function()
    -- ...
    npc.dir(facing);
end,

lookBehind = function()
    npc.aturn(25.0, -9.0, 72.0);     -- turns to look behind
    npc.wait(60);
    npc.aturn_261(facing);           -- back, from the Lua value
end,
```

## Pitfalls

* In `npc.lua` it arrives cut to an integer: `1.676` is `1`.
