<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> 💡 World objects react when the character touches them: they add speed, end the run or give a one-time bonus. All of them are prefabs in Assets/Project Files/Game/Prefabs/World Objects.

</aside>

Subsystems

world-objects-folder.png

BoostRamp

A kicker ramp. The pivot sits on the bottom edge, so rotating the root around the X axis sets the launch angle. The character accelerates while it is inside the trigger over the deck. Driving off the side of the deck loses part of the boost. The arrows chase in a loop and a wave runs up them when the character enters.

Field Description
Acceleration Speed gain while the character is in the trigger.
Arrows Arrow renderers that show the animation.
Idle Color, Chase Color, Wave Color Colors of the arrow animation.
Emission Intensity Glow of the arrows.
Chase Cycle Duration, Chase Sharpness Speed and width of the chase pulse.
Wave Step Duration, Wave Fade Steps Speed of the wave.

The ramp animation runs only while its chunk is active. See Chunk Activation & Run State.

AcceleratorPlatform

A boost pad that never disables itself. Riding over it again boosts again.

Field Description
Speed Boost Speed added on contact.

Ring

An airborne ring that gives a small speed kick to the plane. The ring disappears and comes back on the next run. It inherits from OneShotTrigger.

Field Description
Speed Boost Speed added when the character flies through.
Visual The object that is hidden after the touch.

Chasm

A trigger obstacle. A character whose vehicle has Can Fly disabled fails the run on contact (PlayerController.Fail()). A glider passes over. The component sets the collider to a trigger. No state needs to be reset.

Water

A pond or lake volume. The top face of the trigger is the water surface.

Field Description
Sink Speed Downward speed the character eases to.
Drag How fast the entry velocity is absorbed.
Finish Delay Time between the splash and the end of the run.

On contact, the run ends at the entry point. The run camera stays at the splash, particles and a sound play, and the character sinks. See Run Flow.

OneShotTrigger

Base class for objects that react once per run and come back on the next run. It implements IRunStateObject. On the first contact of the character, it disables its collider, hides the Visual object, registers itself in RunStateController and calls OnTriggered. ResetState() restores it on the next run.

using UnityEngine;

namespace Watermelon
{
    public class SpeedGate : OneShotTrigger
    {
        [SerializeField] private float speedBoost = 5f;

        protected override void OnTriggered(PlayerController character)
        {
            character.AddSpeed(speedBoost);
        }
    }
}

The collider of the object must be a trigger.

How to add a new world object

  1. Create the script. Add a MonoBehaviour with a trigger collider and call PlayerController methods such as AddSpeed or Fail.
  2. Reset the state. Implement IRunStateObject when the object changes during a run. Call RunStateController.MarkDirty(this) when the state changes.
  3. Support chunks. Implement IChunkActivatable when the object has animation or effects that must run only near the character.
  4. Create the prefab. Save it in Prefabs/World Objects and assign the Obstacle or Pickup layer.
  5. Place it. Add the prefab to a level scene and save the scene so the chunks are baked.