<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 pickup is a collectible that the character takes by touching it. A pickup either comes back every run, like a coin, or stays collected forever.

</aside>

Subsystems

pickups-folder.png

Pickup base class

Field Description
Disable After Pickup Off: the pickup comes back every run. On: the pickup stays collected forever.
Unique Id Id of a permanent pickup. The UniqueID drawer generates it for every placed instance.
Visual The object that is hidden after the pickup.
Pickup Particle Name Particle registered in ParticlesController.
Pickup Sound Sound of the pickup.

The two modes:

The permanent state is read after LevelSceneController calls InitSave(levelId). A duplicated pickup instance keeps the id of the original. The UniqueID drawer regenerates the duplicate.

CoinPickup

Field Description
Currency Type Coins by default.
Amount Value of the coin.
Model, Squash Scale, Squash Duration, Rise Height, Rise Duration Collect animation.

Behavior:

GemPickup

Gems are credited at once. The prefab is meant for a one-time bonus, so Disable After Pickup is on and each placed instance has its own id.

Field Description
Amount Number of gems.
Model The spinning model.

Boosters in the world

Class Description
BoosterPickup A booster cube with a specific Booster. It comes back every run.
BoosterBoxPickup A box with a Possible Boosters list. The booster is chosen at the moment of pickup by the Drop Weight of each booster.
BoosterSpawner A point with Spawn Chance (0…1) and a list of entries with a weight. Every run it decides whether a booster appears and which one. Its weights are independent of Drop Weight.

See Boosters Overview for the boosters themselves.

Prefabs

Prefab Content
Coin, Coin Once, Fever Coin Coins. Fever Coin is used by the Coins Fever booster.
Gem One-time gem.
Booster Pickup, Booster Pickup Turbo, Iron Skin, Super Sled, Vehicle Swap, Coins Fever Pickups of each booster.
Booster Box Random Random booster box.
Booster Spawner Random booster point.
Booster Cube The cube visual.

World pickups are stored in Prefabs/World Objects and Prefabs/World.

Shared motion

PickupMotionController computes the spin and bob once per frame. All pickups read the same values, so they move in sync. Use it for every animated pickup.

How to add a new pickup

  1. Create the script. Inherit from Pickup and implement OnCollected.

    using UnityEngine;
    
    namespace Watermelon
    {
        public class SpeedPickup : Pickup
        {
            [SerializeField] private float speedBoost = 5f;
    
            protected override void OnCollected(PlayerController character)
            {
                character.AddSpeed(speedBoost);
            }
        }
    }
    
  2. Add a collider. The pickup needs a trigger collider on the Pickup layer. The Pickup layer collides only with the Player layer.

  3. Create the prefab. Assign the Visual, the particle and the sound.

  4. Decide the mode. Enable Disable After Pickup for a one-time collectible.

  5. Place it. Add the prefab to the level scene and save the scene.