How mralvaroramirez/unity-tps-charactercombat works
This repository is a Unity third-person parkour and freeflow-combat controller built around a hierarchical state machine. The player workflow begins with character input and per-frame state updates, then selects movement or combat behavior and applies movement, animation, and combat effects. The README also documents target-group camera feedback and basic enemy AI; their implementation files are absent from the supplied tree, so those capabilities are shown as documented external dependencies. Relationships below are limited to excerpted code, the source index, and README statements.
Main entry points: PlayerStateFactory.cs State Factory · PlayerAttackState.cs Attack and Combos · PlayerGroundedState.cs Grounded Movement · PlayerStateMachine.cs Player Controller
Components 18
State Machine
- Player Controller
StateMachine/PlayerStateMachine.cs - Hierarchical State
StateMachine/PlayerBaseState.cs - State Factory
StateMachine/PlayerStateFactory.cs
Parkour Movement
- Grounded Movement
StateMachine/PlayerGroundedState.cs - Walk and Run
StateMachine/PlayerWalkState.cs - Jump and Fall
StateMachine/PlayerJumpState.cs - Air Boost
StateMachine/PlayerAirBoostState.cs - Dash
StateMachine/PlayerDashState.cs - Climbing
StateMachine/PlayerClimbingState.cs - Wallrun
StateMachine/PlayerWallRunState.cs - Slope Sliding
StateMachine/PlayerSlidingState.cs - Idle
StateMachine/PlayerIdleState.cs
Freeflow Combat
- Attack and Combos
StateMachine/PlayerAttackState.cs - Damage Response
StateMachine/PlayerDamageState.cs - Skill State
StateMachine/PlayerSkillState.cs
Game Integrations
- Enemy AI
- Action Camera
- Particles and Animation
Connections 26
- Player Controller → State Factory: creates
StateMachine/PlayerStateMachine.cs - Player Controller → Grounded Movement: starts in
StateMachine/PlayerStateMachine.cs - State Factory → Grounded Movement: creates
StateMachine/PlayerStateFactory.cs - State Factory → Walk and Run: creates
StateMachine/PlayerStateFactory.cs - State Factory → Jump and Fall: creates
StateMachine/PlayerStateFactory.cs - State Factory → Air Boost: creates
StateMachine/PlayerStateFactory.cs - State Factory → Dash: creates
StateMachine/PlayerStateFactory.cs - State Factory → Climbing: creates
StateMachine/PlayerStateFactory.cs - State Factory → Wallrun: creates
StateMachine/PlayerStateFactory.cs - State Factory → Slope Sliding: creates
StateMachine/PlayerStateFactory.cs - State Factory → Idle: creates
StateMachine/PlayerStateFactory.cs - State Factory → Attack and Combos: creates
StateMachine/PlayerStateFactory.cs - State Factory → Skill State: creates
StateMachine/PlayerStateFactory.cs - Hierarchical State → Player Controller: sets current state
StateMachine/PlayerBaseState.cs - Grounded Movement → Hierarchical State: inherits
StateMachine/PlayerGroundedState.cs - Jump and Fall → Hierarchical State: inherits
StateMachine/PlayerJumpState.cs - Attack and Combos → Hierarchical State: inherits
StateMachine/PlayerAttackState.cs - Grounded Movement → Walk and Run: selects movement
StateMachine/PlayerGroundedState.cs - Grounded Movement → Jump and Fall: switches to
StateMachine/PlayerGroundedState.cs - Jump and Fall → State Factory: requests fall
StateMachine/PlayerJumpState.cs - Attack and Combos → Enemy AI: targets enemies
StateMachine/PlayerAttackState.cs - Attack and Combos → Action Camera: triggers feedback
StateMachine/PlayerAttackState.cs - Damage Response → Action Camera: triggers feedback
StateMachine/PlayerDamageState.cs - Damage Response → Particles and Animation: generates effects
StateMachine/PlayerDamageState.cs - Attack and Combos → Particles and Animation: generates effects
StateMachine/PlayerAttackState.cs - Player Controller → Particles and Animation: updates animation
StateMachine/PlayerStateMachine.cs