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

# npc.setpos2

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

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

## What it does

Puts the NPC at a point at once, clears any push its collision body carried, and stops any walk it was doing. The placing call of every kit NPC's `init`.

## Arguments

### `x` (Float)

### `y` (Float)

### `z` (Float)

The point, in map coordinates (y up). Under `usemapid(1)` the `y` only has to be near the ground: the NPC is put on the floor.

## Timing

Returns at once.

## In NPC Kit

* Under [usemapid](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/usemapid.md)`(1)`, a point off the walkmesh leaves the NPC at the map's origin.
* In a scene's `close`, on another NPC: `npc.on("id").setpos2(x, y, z)` puts it back on its mark.
* Take the point from the game (NPC Kit Editor shows it); never invent coordinates.

## Used with

* [usemapid](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/usemapid.md) before it, [dir](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/dir.md) and [fetchambient](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/fetchambient.md) after it, in the vanilla setup (`references/staging.md`).
* [setpos](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setpos.md): the same placing without the collision reset.

## Example

```lua
npc.usemapid(1);
npc.usecharhit(1);
npc.setweight(-1);
npc.set_ignore_hitgroup(1);
npc.motionloop(1);
npc.setpos2(29.36, -9.0, 68.65);
npc.dir(1.676);
npc.fetchambient();
```
