> For the complete documentation index, see [llms.txt](https://mango-5m.gitbook.io/mango5m-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mango-5m.gitbook.io/mango5m-docs/free-resources/mango-positions/fit-to-object.md).

# Fit to Object

Work out where a body belongs on a thing — a patient on a trolley, someone on a bed, a passenger on a seat — and copy the attach offset.

Open the tool with `/mpos` and press **`3`**.

Every script that puts a player *on* something calls `AttachEntityToEntity`, and every one of those calls wants an offset and a rotation. Guessing them is miserable: you edit a number, restart the resource, look, and edit it again.

The fit tool lets you do it by eye, in one pass.

## How it works

{% stepper %}
{% step %}

### Look at the thing

A line is drawn from wherever you are looking, so you can see exactly what the picker is testing instead of guessing from a crosshair. It turns amber the moment it lands on something takeable, and that object is outlined in the same amber. The picker reaches `Config.FitReach` metres — 12 by default.
{% endstep %}

{% step %}

### Press ENTER to pick it

A transparent clone of your own ped appears, attached to that object. From this moment the tool is measuring, not placing.
{% endstep %}

{% step %}

### Nudge the clone into place

`WASD` moves it, the arrow keys raise, lower and turn it, and `E` / `Q` change its pose so you are fitting the shape that will really be there — a lying body, not a standing one.
{% endstep %}

{% step %}

### Press ENTER again to copy

The two lines a script is asking for land on your clipboard.
{% endstep %}
{% endstepper %}

## Controls

| Key             | Action                                             |
| --------------- | -------------------------------------------------- |
| `ENTER`         | Pick the outlined object — then, once picked, copy |
| `W` `A` `S` `D` | Move the clone along the object's axes             |
| `↑` `↓`         | Up and down                                        |
| `←` `→`         | Turn                                               |
| `ALT` + arrows  | Pitch and yaw instead                              |
| `SHIFT`         | Faster                                             |
| `E` / `Q`       | Next / previous pose                               |
| `X`             | Drop the object and pick another                   |
| `V`             | Freecam                                            |
| `1` `2` `3`     | Switch to the ped, prop or fit tool                |
| `ESC`           | Close                                              |

## What lands on your clipboard

```lua
offset = vec3(0.0000, 0.1200, 0.5800),
rot = vec3(0.00, 0.00, 90.00),
```

Which is what your own attach call is waiting for:

```lua
AttachEntityToEntity(ped, bed, 0,
    offset.x, offset.y, offset.z,
    rot.x, rot.y, rot.z,
    false, false, false, false, 2, true)
```

{% hint style="success" %}
**Movement is in the object's frame, not the world's.** Press `W` and the clone slides along the *bed*, not north. That is deliberate — an attach offset is measured in the object's own axes, so a key that moved the clone north would be moving it somewhere the numbers cannot describe.
{% endhint %}

## Fitting to something that moves

A vehicle is a valid target, and the panel names it by its display name rather than a hash. Because the clone is genuinely attached, you can fit an offset on a vehicle that is not level — the numbers stay correct, since they are relative to the vehicle either way.

{% hint style="info" %}
Picked the wrong thing? Press `X`. It releases the object, clears the offset back to zero and puts you back in aiming mode — no need to close the tool and run the command again.
{% endhint %}

## If nothing highlights

The aim line shows you exactly how far the picker reaches and where it lands, so a miss is visible rather than mysterious. If the line stays white:

* You may be further away than `Config.FitReach`. Move closer or raise it.
* Some map geometry is not an entity at all — a baked-in MLO wall has nothing to attach to. Props, vehicles and peds all work.
* In freecam the line is cast from the lens, not from your body, so aim with the camera.
