Wait

Wait an amount of time before continuing

Description

'wait [time]'

The wait action pauses script execution for a specified amount of time or until the player interacts. Once the time has passed (or the player clicks), the game automatically continues to the next statement.

Action ID: Wait

Reversible: Yes

Requires User Interaction: Optional (required if no time specified)

Parameters

Name
Type
Optional
Description

time

number

Yes

The time in milliseconds to wait before continuing.

Behavior

With Time Parameter

When a time value is provided, the game:

  1. Blocks all user interaction

  2. Waits for the specified duration

  3. Automatically advances to the next statement

In this example, after the first dialog is shown and the player clicks to continue, the game waits for 5 seconds (5000 milliseconds) before showing the next dialog.

Without Time Parameter

When no time is provided, the game pauses and waits for user interaction:

This is useful for creating pause points where you want the player to manually advance.

Time Conversion

The wait action accepts time in milliseconds. Common conversions:

Duration
Milliseconds

1 second

1000

5 seconds

5000

10 seconds

10000

1 minute

60000

0.5 seconds

500

Error Handling

If an invalid (non-numeric) time value is provided, the engine will display an error:

The error message will indicate the invalid time value and the location in your script.

Examples

Dramatic Pause

Scene Transition Delay

Timed Event Sequence

Technical Details

  • During a timed wait, the block global is set to true, preventing user interaction

  • When the time elapses, block is set back to false

  • The action uses setTimeout internally for timing

  • End - End the game

  • Jump - Jump to another label

Last updated

Was this helpful?