Skip to main content
The LostLevelCause enum describes every way a player can fail a RollingQuest level. You pass one of these values to Level.loseLevel(cause) to trigger a level-failure sequence with the appropriate feedback — the cause drives the failure animation, sound, and message shown to the player. Picking the most accurate cause keeps the player experience consistent with the rest of the game and makes your custom triggers feel native to the engine.

Values

Usage Example

The example below demonstrates a custom trap that kills the ball with the Lasered cause when a laser sensor detects it, and a time-pressure trigger that calls TimeOut when a countdown block hits zero:
You can also use LostLevelCause in a scripted hazard zone that burns the ball when it enters a fire region: