# sm.exists

Returns whether an object exists in the game. This is useful for checking whether a reference to an object is valid.

**Kind:** Function

**Environments:** Game, Terrain

## Game

``` { .lua .api-signature }
sm.exists( object )
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.md#exists)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `object` | any | The object instance. |

**Returns:**

| Type | Description |
| --- | --- |
| boolean | Whether the object exists. |

## Terrain

``` { .lua .api-signature }
sm.exists( object )
```

[Open the full Terrain reference](../Terrain-Script-Environment/Static-Functions/sm.md#exists)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `object` | any | The object instance. |

**Returns:**

| Type | Description |
| --- | --- |
| boolean | Whether the object exists. |
