> 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/dir_4e.md).

# npc.dir\_4e

```lua
npc.dir_4e(x, y, z)
```

|                         |                                 |
| ----------------------- | ------------------------------- |
| id                      | `0x004E`                        |
| arguments               | 3: Float, Float, Float          |
| in NPC Kit              | yes                             |
| measured from a kit NPC | returns                         |
| vanilla scripts         | 107 calls in 34 of 1114 scripts |

## What it does

Turns the NPC to face a point at once, a turn of zero frames, and the script goes on.

## Arguments

### `x` (Float)

### `y` (Float)

Popped, but the turn doesn't use it.

### `z` (Float)

The point, in map coordinates. The NPC faces `(x, z)`.

## Timing

Returns at once; the NPC faces the point on the next frame.

## In NPC Kit

In `init`, after `setpos2`, it saves computing the heading: face the point the NPC should look at.

## Used with

* [setpos2](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setpos2.md) before it in `init`.
* [dir](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/dir.md): a heading instead of a point; [dira](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/dira.md): an actor.
* [turn](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/turn.md): the same turn, visible, with a wait.

## Example

```lua
npc.setpos2(29.36, -9.0, 68.65);
npc.dir_4e(33.0, -9.0, 68.6);   -- face the other post
```

## Pitfalls

* In view of the player it snaps. For a turn the player sees, use [turn](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/turn.md).
