> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rollingquest.kramgames.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Testing Levels

> How to test your level directly from the RollingQuest editor: gameplay mode, returning to the editor, and testing workflow.

The editor lets you test your level instantly without leaving the editor environment. Press **T** to start a test playthrough.

## Starting a Test

Press **T** from the editor viewport, or use **Escape** → **Test Level**.

## What Happens During a Test

1. The current level data is built from the editor state
2. The data is stored in `EditorPersistentState`
3. `GameplayController.StartEditorGameplay` is called
4. The gameplay scene loads with your level
5. You play the level as a player would

## During the Test

* The game runs normally with all scripts, physics, and mechanics active
* You can play through the level from start to finish
* The timer, lives, and score systems work as they would in the final game
* Enemy behaviors, item collections, and ball physics are fully functional

## Returning to the Editor

Press **Escape** during the test to return to the editor. The editor restores:

* Your previous camera position
* The block selector position
* All placed elements (unchanged from before the test)

## Testing Conditions

The test is blocked if:

* A menu is currently open
* The editor is in a loading state

## Test Data Flow

```
Editor State → BuildDataFromLevel() → LevelData → GameplayController → Gameplay Scene
```

The level data includes:

* All blocks, items, enemies, balls across all sections
* Level properties (time, lives, hourglass)
* Section properties (themes, music, lava pools)
* Script references and variables
* Messages

## Best Time Tracking

If you complete the level during testing, the editor records your completion time as `BestEditorElapsedTime`. This is displayed in the HUD and saved with the level.

<Note>
  Testing creates a temporary campaign with your level. No external files are modified — the test runs entirely in memory.
</Note>
