<aside>
<img src="/icons/reorder_gray.svg" alt="/icons/reorder_gray.svg" width="40px" />
Navigation
</aside>
🏠 Home Page
Getting Started
Architecture
Level System
Characters & Vehicles
Run Mechanics
World Objects
Boosters & Modifiers
Progression & Economy
UI
Save & Debugging
Modules
Publishing
Reference
💰 Monetization (Ads & IAP)
<aside>
💡 A new level needs a level scene, a Character, a Level asset and an entry in the Levels Database.
</aside>
Steps
- Create the level scene. Duplicate an existing level scene in Assets/Project Files/Game/Scenes, for example Level 3, and rename it. The duplicate already has the required objects: Level Scene Controller, Start Point, Finish Point and Finish Wall. See Level Scene.
- Build the level content. Edit the terrain and the objects. Run the level along the world Z axis. Move the Start Point and the Finish Point. Place the Finish Wall on the Finish Point. To generate the terrain, see Level Generation Tools.
- Save the scene. The save bakes the chunks and the start and finish references into the Level Scene Controller.
- Create the Character. Open Create → Watermelon → Progression → Character. Assign the vehicle prefab, the icon, the title, the run camera and the three upgrades. To reuse an existing vehicle and its upgrades, link an existing Character instead. The levels that share a Character share the upgrades. See Characters & Vehicles.
- Create the Level asset. Open Create → Watermelon → Progression → Level. Select the new asset in the Inspector, so the Id is generated. Assign the Scene and the Character.
- Set the LevelSetup. Leave Setup Override empty to use the default launcher, or assign a LevelSetup. See Level Setup.
- Set the music. Assign a clip to Music, or leave the field empty to use the global track.
- Register the level. Open Levels Database and add the Level to the Levels array. The position in the array is the play order.
- Add the scene to the Build Settings. Add the scene in File → Build Settings. Without this, the
LevelTests fail and LevelScenesBuildCheck warns before a build.
- Test the level. Open the level scene and press Play. See Testing in the Editor.
Check with the Editor tests
Open Window → General → Test Runner, select EditMode and run the tests of the Watermelon.Tests namespace. The tests check every Level asset:
| Test class |
Checks |
| LevelTests |
A Character is linked, the id is set, the ids are unique, the scene is linked and exists, the scene is enabled in the Build Settings and contains a Level Scene Controller with baked start and finish points. |
| LevelsDatabaseTests |
The database has at least one level and contains every Level asset of the project, and the lookup methods return the expected values. |
| GameControllerSceneWiringTests |
GameController in the Game scene has a Levels Database and a Level Index inside the database range. |
| StartSceneModifierTests |
The Editor start override for level scenes. |
A Level asset that is not in the Levels Database fails LevelsDatabaseTests.
Common problems
| Problem |
Cause and fix |
No active StartPoint found in scene |
The scene has no enabled StartPoint. Add one. |
| The character stands in the wrong place or the progress bar is wrong |
The Start Point and the Finish Point moved after the last save. Save the scene. |
| Two levels share pickups and the record |
The Level asset was duplicated. Reset the Id of the copy. |
| The level is missing in the build |
The scene is not enabled in the Build Settings. |
| Objects far from the character do not react |
They are outside Active Chunk Radius. Increase the radius or the Chunk Size. |
| The level scene does not start with Play |
A level scene needs Game. Start it through Init. See Testing in the Editor. |