GAME 1303 — Tier 3: Movement Add-ons & Signature Mechanics
Eighteen scripts that bolt onto the Tier 1 player. Most are true drop-ins: add the component, done. Three Tier 1 files get a small v1.1 update (in Tier1_Updates/ — replace the originals):
PlayerController2Dv1.1 — addsMovementLocked,SpeedMultiplier,CanCoyoteJump,ForceJump(),ClearJumpBuffer(),JumpHeld,MoveVector,Facing,FaceDirection(),BaseGravity. Behaviour is otherwise identical.Healthv1.1 — addsSetInvulnerable(seconds),ClearInvulnerability(),SetMaxHealth(),SetCurrentHealth().DamageOnContactv1.1 — now respects its enabled checkbox (Unity sends collision messages to disabled components; this fixes that soMetalObjectcan toggle it).
Scripts/
Movement/ Dash, DoubleJump, Glide, Sprint, WallSlideJump, Ladder + LadderClimber,
MomentumLauncher, GrapplingHook
Balloon/ BalloonController, FuelSystem, FuelPickup, WindZone2D
Special/ MagnetPull + MetalObject, RailRide + Rail, CharacterDefinition + CharacterSwapper
Tier1_Updates/ PlayerController2D, Health, DamageOnContact (v1.1)
How the modules cooperate (worth explaining once)
PlayerInput in Send Messages mode calls OnJump, OnMove, OnAttack... on every component on the player. So DoubleJump, WallSlideJump, LadderClimber, RailRide and GrapplingHook all hear the Jump press and decide among themselves who acts: the controller if grounded/coyote, otherwise wall jump > ladder jump > double jump. While a module owns the body (dash, wall-jump lock, ladder, rail, rope) it sets controller.MovementLocked = true so the base controller stops writing velocity, and clears it when done. Anything that grants temporary i-frames goes through Health.SetInvulnerable.
Input actions to add (Input Actions asset → Player map)
| Action | Type | Suggested bindings | Used by |
|---|---|---|---|
Dash | Button | Left Shift, gamepad B/East | Dash (or tick Use Sprint Action) |
Grapple | Button | Right Mouse, gamepad LT | GrapplingHook |
Magnet | Button | Right Mouse, gamepad LT | MagnetPull |
Character1…Character4 | Button | 1–4 keys | CharacterSwapper (optional; Q/E Previous/Next already exist) |
Everything else uses the default Move, Jump, Attack, Sprint, Previous, Next.
Per-game quick recipes
- Apep's Trial (2D mode) — Dash, DoubleJump, Glide, Sprint. All four coexist without configuration.
- Zap Attack — Dash (Invulnerable ✓, plus a child Hitbox toggled by OnDashStarted/Ended for dash-through), WallSlideJump, RailRide + power-line
Railobjects. - Stardust — Dash, WallSlideJump (+ Tier 2 MeleeAttack/ComboCounter).
- Spark of Corruption — CharacterSwapper with four
CharacterDefinitions; abilities per character: Fire Aprice → MeleeAttack, Dash; Servant → GrapplingHook, DoubleJump; Archer → ProjectileShooter, WallSlideJump; Sorcerer → ProjectileShooter, Glide. Shared health off or on — designer's call. - Roach Invasion — CharacterSwapper, Separate Health Per Character ✓ (5/3/2/3 HP per insect), abilities: bee → Glide + DoubleJump; others → LadderClimber, Dash, etc. Wire
Health.OnDied → CharacterSwapper.OnCurrentCharacterDiedinstead ofRespawnManager.OnPlayerDied, andRespawnManager.OnRespawned → CharacterSwapper.ReviveAll. - Missile Man — Sprint + MomentumLauncher (with a disabled child Hitbox, big knockback). Set Tier 2 MeleeAttack off or don't add it.
- Hot Air — no PlayerController2D. BalloonController + FuelSystem + GrapplingHook (Aim = Mouse) + Health + Tier 1 Checkpoint/RespawnManager. Wire
RespawnManager.OnRespawned → BalloonController.ResetMotionandFuelSystem.RefillFull. ScatterFuelPickups andWindZone2Ds (rotate to aim). - The Magnet — MagnetPull with a HoldPoint child; metal props on a
Metallayer withMetalObject+ a disabledDamageOnContact(Target Tag Enemy). Enemy weapons/shields as separate metal rigidbodies attached with a joint the player can break by pulling — an advanced follow-up. - Detective Liz — LadderClimber for floor changes (or Tier 6 FloorTransition later).
Animator parameters these scripts use (all optional — they check first)
Triggers: Dash, DoubleJump, Launch. Bools: IsGliding, IsWallSliding, IsClimbing, IsRiding. Float: ClimbSpeed.
AudioManager names referenced
dash, jump, launch, magnet, throw, rail_on, collect.
Notes for the instructor
CharacterSwapperdeliberately uses one player object with all ability components present and togglesenabledper character; it avoids the camera/PlayerInput/RespawnManager churn of swapping prefabs.CharacterDefinition.enabledAbilitiesis a list of component class names — typos silently disable the ability, so a quick check in class is worthwhile.GrapplingHookcreates its ownDistanceJoint2Dat runtime; students shouldn't add one manually.RailRidewalks theEdgeCollider2Dpolyline segment by segment, so wires can have any number of bends.FindFirstObjectByType(CharacterSwapper) is Unity 2023+/6; on 2022 change toFindObjectOfType.- Same caveat: hand-reviewed, not compiled here. Tier 3 has more interacting parts than 1–2, so an import-and-play pass matters more this time — especially the Jump ownership chain.