<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 VehicleData asset chooses the movement of a vehicle and its optional visual. The MovementBehavior it creates steers the character. The same system powers the vehicle swap booster.

</aside>

Subsystems

At every ResetToStart, the controller builds a fresh behavior from Default Vehicle. Upgrades bought since the last run therefore apply to the next run.

vehicles-folder.png

VehicleData fields

Field Description
Visual Prefab Optional vehicle visual that replaces the default one while this vehicle is active.
Can Fly Capability flag. Obstacles such as Chasm read it to decide whether the vehicle can clear them.
Hide Character Hides the rider while this visual is shown. When disabled, the rider sits on the Seat of the visual.

CreateBehavior() can return null. The vehicle then changes only the visual and the controls stay the same.

Included vehicles

Menu: Create → Watermelon → Character → Vehicles.

Asset Class Movement
Character Vehicle CharacterVehicleData Sled. Forward motion comes from the launch velocity and physics. A held stick turns the heading, a small swing of the travel direction gives an instant response. A hit above Crash Impact Speed ejects the character.
Car Vehicle CarVehicleData Car on real rigidbody physics with one WheelCollider per wheel. Gravity drives it. The stick turns the front wheels. Grip and resistance depend on the surface under each wheel. The run ends when the car lies on its side or roof for the Flipped Fail Time.
Wheel Vehicle WheelVehicleData Rolling wheel. A slope accelerates it. The lean of the wheel turns it, like a rolling coin. Below the stable speed it wobbles, topples and ends the run. Bounces on landing.
Airplane Vehicle AirplaneVehicleData Propeller plane. The stick sets the pitch and the bank. The engine pushes while there is fuel, then the plane glides. Below the stall speed the nose falls. A hard landing or a head-on hit breaks the plane.
Plane Vehicle PlaneVehicleData Glider used by the Vehicle Swap booster. It only turns the speed that the character already has.
Super Sled Vehicle VisualOnlyVehicleData Visual swap only. Used by the Super Sled booster.

How the upgrades change a vehicle

CreateBehavior() reads the current stage of the VehicleEfficiency upgrade and the multiplier from ProgressionController.

Vehicle Upgrade Values from the stage
Sled VehicleEfficiencyUpgrade Friction relief from the efficiency multiplier.
Car CarUpgrade Grip, Rolling Resistance, Drag.
Wheel WheelUpgrade Rolling Resistance, Min Stable Speed.
Airplane PlaneUpgrade Drag, Stall Speed, Lift Response, Fuel.

The values in the VehicleData asset are the fallback when no upgrade is loaded, for example when the vehicle is used by a swap booster on another level.

Surfaces

CarVehicleData uses the Surface Database and a Surfaces list. Each entry sets, for a SurfaceType (Normal, Ice, Snow, Grass, Sand): the grip multiplier, the resistance multiplier, the dust amount and the dust color. A type that is not listed behaves like normal ground.

Writing a MovementBehavior

MovementBehavior methods:

Method Description
OnEnter(character) The behavior becomes active: at awake, on a swap and on every ResetToStart. Reset the state here.
OnExit(character) The behavior stops being active.
TickMovement(character) Movement update while launched. Required.
TickVisual(character) Visual reaction (lean, heading). Never touches physics.
OnCollision(character, collision) Solid hit while launched.
CameraHeadingFromVelocity, CameraYawOffset Run camera heading.
HasFuel, FuelShare Shows the fuel gauge on the run HUD.
GetTrackContacts(character, contacts) Terrain track points of the vehicle.

The steering value comes from character.MoveValue (Vector2). The sled and the car read the horizontal axis, the plane reads both.