Vehicle SwitchingTraversal

Player transitions between fundamentally different movement configurations during play, each with distinct physics.

The player swaps movement modes with distinct physics — a slow walk and a fast vehicle.

How vehicle switching works in Godot

Switching isn't loading a new character — it's enabling one physics configuration and disabling another while keeping the same world position.

enumprimitive

A mode flag (ON_FOOT / IN_TANK) decides which physics and input branch runs this frame. One variable gates the whole behavior split.

enum Mode { ON_FOOT, IN_TANK }
var mode = Mode.ON_FOOT

func _physics_process(d):
    match mode:
        Mode.ON_FOOT: walk(d)
        Mode.IN_TANK: drive(d)

CharacterBody2Dnode

Give each mode its own body with its own SPEED/ACCEL/gravity tuning. The active one processes; the other sleeps at the shared position.

func enter_tank():
    $Tank.global_position = $OnFoot.global_position
    mode = Mode.IN_TANK

Node2Dnode

A parent that holds both vehicle scenes. Toggle visibility and processing so only the active configuration is live.

$OnFoot.set_physics_process(mode == Mode.ON_FOOT)
$Tank.set_physics_process(mode == Mode.IN_TANK)

In short: Multiple CharacterBody2D setups or mode enum; active mode controls which physics/input code runs

Retro games that use vehicle switching

9 catalogued game(s) use this mechanic, spanning 1988–1996.

Related traversal mechanics

▶ Explore Vehicle Switching interactively — see every game + the Godot system