# object.move

Source: https://docs.lightair.app/developers/remote-api/object.move

> Moves an object forward or back among the objects beside it.

JSON-RPC 2.0 method of Lightair's Remote API (ws://localhost:4455/rpc). Group: Objects and sources. Script plugins need the `project.write` permission.

`to` counts from the back, from 0. Objects in a group move among that group's objects.

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `object` | `string` | yes | The object's id or name. |
| `scene` | `string` | no | Its scene's id or name. Default: the scene being edited. |
| `position` | `string` | no | `front`, `back`, `forward` or `backward`. |
| `to` | `number` | no | An index from the back, instead of `position`. |

## Result

| Name | Type | Required | Description |
|---|---|---|---|
| `index` | `number` | no | Where it is now, from the back. |

## Errors

Invalid params (-32602) without `position` or `to`. Not found (-32004) for an unknown scene or object.

## Events

- `workspace.changed`

## From an AI agent

The MCP server's `move_object` reaches this method.

## Example

```json
{ "jsonrpc": "2.0", "id": 1, "method": "object.move", "params": { "object": "Webcam", "position": "front" } }
```

Result:

```json
{ "index": 4 }
```

## Related

- [object.update](https://docs.lightair.app/developers/remote-api/object.update.md)
- [state.get](https://docs.lightair.app/developers/remote-api/state.get.md)
