<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 booster needs a script, an asset, an entry in the Booster Database and a pickup prefab.

</aside>

Steps

  1. Create the booster script. Inherit from TimedBooster for an effect with a duration or from InstantBooster for a one-shot effect. Implement OnActivated. A timed booster also implements OnDeactivated to revert the effect.

    using UnityEngine;
    
    namespace Watermelon
    {
        [CreateAssetMenu(fileName = "Magnet Booster", menuName = "Watermelon/Boosters/Magnet")]
        public class MagnetBooster : TimedBooster
        {
            [SerializeField] private float range = 6f;
    
            public override void OnActivated(PlayerController character)
            {
                // Start the effect
            }
    
            public override void OnDeactivated(PlayerController character)
            {
                // Revert the effect
            }
        }
    }
    
  2. Create the asset. Open Create → Watermelon → Boosters → Magnet and save it in Assets/Project Files/Data/Boosters.

  3. Fill the fields. Set a unique Id, the Icon, the Frame Material, the Drop Weight, the Activation Sound and the Duration.

  4. Register the booster. Open Assets/Project Files/Data/Booster Database.asset and add the asset to the Boosters array.

  5. Create the pickup prefab. Duplicate Booster Pickup in Prefabs/World Objects, assign the Booster and the cube frame material.

  6. Place it. Add the pickup, a Booster Box Random entry or a Booster Spawner entry to a level scene. Save the scene.

Rules

Adding a character reaction

PlayerController.OnEffectActivated(effectId) receives the Id of the booster. Override it in a PlayerController subclass, or extend BoosterVisualBehavior, to add a visual that is specific to the booster.

Timed booster that changes the vehicle

Use VehicleSwapBooster. Create a VehicleData asset for the vehicle and assign it to the Vehicle field. See Vehicle Data & Movement Behaviors.

character.SwapVehicle(vehicle);
character.RevertVehicle();

HUD

ActiveBoosterHUD shows every timed booster in a free slot of the list. The number of slots in the UI Game prefab limits the number of active timed boosters that are displayed. Add slots to the list for more.