# Effect.setDetachOnHostDestroy

Detaches the effect from its host object when the host disappears.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
effect:setDetachOnHostDestroy( detach )
```

[Open the full Game reference](../Game-Script-Environment/Userdata/Effect.md#setdetachonhostdestroy)

**Availability:** Client only

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `effect` | [Effect](../Game-Script-Environment/Userdata/Effect.md) | The effect. |
| `detach` | boolean | If the effect should automatically detach from the host or not. |
