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

# npc.lookatrt

```lua
npc.lookatrt(rotation, timeFrames)
```

|                         |                                                                         |
| ----------------------- | ----------------------------------------------------------------------- |
| id                      | `0x04C8`                                                                |
| arguments               | 2: Float, Float                                                         |
| in NPC Kit              | yes                                                                     |
| measured from a kit NPC | returns                                                                 |
| waits                   | it has a wait handler: it can hold the script, and in `talk` the player |
| vanilla scripts         | 111 calls in 12 of 1114 scripts                                         |

## What it does

Turns the NPC's head to an angle from where its body faces, over a set number of frames, and holds the script until the head is there. `lookatrt(0, 30)` brings the head back to straight smoothly.

## Arguments

### `rotation` (Float)

The head's yaw from the body, in radians; `0` straight ahead. Vanilla: `0` most (26 of 111), then `±0.2`, `±0.35`, `±0.5`.

### `timeFrames` (Float)

How long the turn takes, in frames. Vanilla: `30` most, then `0` (the head's normal speed).

## Timing

Waits until the head has turned. [rlookatrt](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/rlookatrt.md) is the same without the wait.

## In NPC Kit

In the editor's Head group, live on the selected NPC.

## Used with

* [rlookatrt](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/rlookatrt.md): no wait.
* [lookatrt\_4c9](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/lookatrt_4c9.md): with a pitch.
* [lookatoff](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/lookatoff.md): ends the look; `lookatrt(0, 30)` before it avoids a snap.

## Example

The NPC looks aside, then back, smoothly.

```lua
doubt = function()
    npc.lookatrt(0.5, 30);   -- aside over 30 frames; waits
    npc.wait(20);
    npc.lookatrt(0.0, 30);   -- back to straight
    npc.lookatoff();
end,
```

## Pitfalls

* The second argument is a duration, not a pitch: the pitch form is `lookatrt_4c9`.
