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

# npc.usecharhit

```lua
npc.usecharhit(state)
```

|                         |                                   |
| ----------------------- | --------------------------------- |
| id                      | `0x0083`                          |
| arguments               | 1: Int                            |
| in NPC Kit              | yes                               |
| measured from a kit NPC | returns                           |
| vanilla scripts         | 6377 calls in 576 of 1114 scripts |

## What it does

Makes the NPC collide with other characters (`1`) or lets them pass through it (`0`). On, the NPC is a body the movement and battle obstruction tests take into account.

## Arguments

### `state` (Int)

`1` (any non-zero) solid, `0` passes through. Vanilla: `0` 3,941 times, `1` 2,436.

## Timing

Returns at once.

## In NPC Kit

The vanilla setup turns it off first, binds the model, and turns it on again after the motion: `usecharhit(0)` before `bindp2_d4`, `usecharhit(1)` before `setweight`. Without it, with `setweight` and `set_ignore_hitgroup`, the player pushes the NPC around.

## Used with

* [setweight](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setweight.md)`(-1)`: not pushed.
* [set\_ignore\_hitgroup](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/set_ignore_hitgroup.md): whom it blocks.
* [usemapid](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/usemapid.md): on the floor.

## Example

```lua
npc.usecharhit(0);
npc.bindp2_d4(0x006E0013, 4, 3);
-- ... motion ...
npc.usemapid(1);
npc.usecharhit(1);
npc.setweight(-1);
npc.set_ignore_hitgroup(1);
```
