# sm.gui.startFadeToBlackWaitForWorld

Fades the screen to black, waits for the world to finish loading, then fades back.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
sm.gui.startFadeToBlackWaitForWorld( duration, timeout )
```

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

**Availability:** Client only

First waits until timeout, then holds black until the world is ready or a max timeout is reached.

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `duration` | number | Animation duration |
| `timeout` | number | Seconds until the fade starts waiting for the world |
