How art-of-the-art/code-salvage-game works
Purpose and Scope
Unity gameplay prototype for a third-person human player confronting large robots. The implemented code concentrates on locomotion, climbing/attachment, camera control, animation integration, and debugging—not yet the README’s damage, dismantling, or enemy-combat systems.
Runtime Entry Points
Unity invokes MonoBehaviour lifecycle methods on scene-attached components. The player is assembled from cooperating scripts, while the robot has a separate movement controller:
• PlayerMovement.cs
• PlayerClimbMotor.cs
• RobotMovement.cs
Player Input and Locomotion
PlayerInputReader.cs is the input boundary, translating Unity player controls into movement/action state consumed by player systems. PlayerMovement.cs is the primary grounded locomotion controller and likely owns ordinary movement-state decisions. This separates device/input concerns from physical motion:
• PlayerInputReader.cs
• PlayerMovement.cs
• PlayerGroundProbe.cs
Environmental Sensing and Movement Modes
Player movement is driven by probes rather than assuming a flat ground plane. PlayerGroundProbe.cs determines grounded/surface information; PlayerFrontDetector.cs detects climbable or blocking geometry ahead. PlayerClimbMotor.cs uses those contacts to control the attached/climbing mode, forming the key boundary for climbing robots or level geometry:
• PlayerGroundProbe.cs
• PlayerFrontDetector.cs
• PlayerClimbMotor.cs
Animation and Presentation
PlayerAnimationBridge.cs maps gameplay/movement state into the Unity animation layer, avoiding direct animation ownership inside locomotion controllers. ThirdPersonCamera.cs supplies player-following third-person camera behavior, independent from movement and climbing logic:
• PlayerAnimationBridge.cs
• ThirdPersonCamera.cs
• PlayerMovement.cs
Robot Actor
RobotMovement.cs is the present robot-side runtime behavior. It is architecturally separate from player climbing, meaning interaction with a moving robot must occur through scene physics/transforms and detector/probe contacts rather than a dedicated player–robot orchestration layer:
• RobotMovement.cs
• PlayerClimbMotor.cs
• PlayerFrontDetector.cs
Observability and Current Boundaries
PlayerDebugHud.cs exposes runtime player state for tuning movement, detection, and climbing behavior. The repository contains no visible systems for combat, destructible robot parts, weapons, persistence, networking, backend services, or non-Unity infrastructure. Unity physics, animation, input, and scene/component composition are the material platform dependencies:
• PlayerDebugHud.cs
• PlayerMovement.cs
• PlayerClimbMotor.cs
Main entry points: PlayerClimbMotor.cs Climb Motor · PlayerMovement.cs Player Movement · PlayerInputReader.cs Player Input Reader · PlayerFrontDetector.cs Front Detector
Components 13
Player Runtime
Cooperating scene-attached player components.
- Player Input Reader · Translates Unity controls into player movement and action state.
PlayerInputReader.cs - Player Movement · Owns ordinary grounded movement-state decisions.
PlayerMovement.cs - Ground Probe · Determines grounded and surface information.
PlayerGroundProbe.cs - Front Detector · Detects climbable or blocking geometry ahead.
PlayerFrontDetector.cs - Climb Motor · Controls attached and climbing movement from contact data.
PlayerClimbMotor.cs - Animation Bridge · Maps gameplay movement state into Unity animation.
PlayerAnimationBridge.cs - Third-Person Camera · Provides player-following camera behavior independently of movement.
ThirdPersonCamera.cs - Player Debug HUD · Exposes runtime movement, detection, and climbing state.
PlayerDebugHud.cs
Robot Runtime
- Robot Movement · Current robot-side runtime behavior.
RobotMovement.cs
Unity Platform
Engine services and scene composition.
- Scene Components · Attaches MonoBehaviours and provides actor transforms.
- Unity Physics · Provides collision, probe, and contact data.
- Unity Input
- Unity Animation
Connections 22
- Scene Components → Player Input Reader: attaches
- Scene Components → Player Movement: attaches
- Scene Components → Climb Motor: attaches
- Scene Components → Robot Movement: attaches
- Unity Input → Player Input Reader: controls
- Player Input Reader → Player Movement: movement state
- Player Input Reader → Climb Motor: action state
- Unity Physics → Ground Probe: surface contacts
- Unity Physics → Front Detector: forward contacts
- Ground Probe → Player Movement: grounded state
- Front Detector → Climb Motor: climb contacts
- Ground Probe → Climb Motor: surface state
- Player Movement → Climb Motor: mode handoff
- Player Movement → Animation Bridge: movement state
- Climb Motor → Animation Bridge: climb state
- Animation Bridge → Unity Animation: animation parameters
- Scene Components → Third-Person Camera: player transform
- Player Movement → Player Debug HUD: locomotion state
- Climb Motor → Player Debug HUD: climb state
- Front Detector → Player Debug HUD: detection state
- Robot Movement → Unity Physics: moves collider
- Unity Physics → Front Detector: robot or level geometry