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

# npc.setpos

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

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

## What it does

Puts the NPC at a point at once and stops any walk it was doing. Unlike [setpos2](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setpos2.md) it leaves the collision body as it was.

## Arguments

### `x` (Float)

### `y` (Float)

### `z` (Float)

The point, in map coordinates (y up). Vanilla uses it most in map and scene scripts (12,698 calls), often with computed values; `setpos2` is the one NPC setups use.

## Timing

Returns at once.

## In NPC Kit

Works on a kit NPC; the kit's examples place with `setpos2`. Prefer it when the NPC lands next to other bodies, so no leftover push shoves it.

## Used with

* [setpos2](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setpos2.md): placing with the collision reset.
* [dir](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/dir.md): the heading at the new point.

## Example

An NPC that steps out of sight in the black and is back at its post when the screen fades in.

```lua
backToPost = function()
    npc.fadeout(15);
    npc.fadesync();
    npc.setpos(29.36, -9.0, 68.65);
    npc.dir(1.676);
    npc.wait(3);
    npc.fadein(15);
    npc.fadesync();
end,
```

## Pitfalls

* Placed next to another body, a leftover push can shove it: use [setpos2](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setpos2.md) there.
