Overcoming animation pipeline challenges and implementing scalable combat logic in an AAA-scale Unity prototype.
This was my first project with an AAA-scale scope ambition. The sheer number of interacting systems (Movement, Combat, UI, Quests) quickly led to a tightly coupled player controller that became a classic "God Class", making debugging and iteration increasingly fragile.
The Solution: I refactored the monolith
into modular components by
separating PlayerInput from the
ActionController and introducing
a dedicated AnimationInterface. This
architectural shift reinforced the
importance of the Single Responsibility
Principle in large-scale gameplay systems.
Integrating Mixamo assets exposed several systemic animation issues, including character sliding ("ice skating"), T-poses, and mesh deformation during runtime.
The Root Cause: A conflict between Root Motion and code-driven velocity. Some animations translated the root bone while others were strictly "In-Place", resulting in competing movement calculations. Additionally, inconsistent rig definitions introduced bone mapping errors.
The Fix:
Humanoid avatar definition to ensure
reliable retargeting.
CharacterController to own movement
physics.
To eliminate "floating hits"—where enemies took damage before visual contact—I implemented an Animation Event–driven combat pipeline.
// Ensuring damage matches visuals exactly
public void OpenHitbox()
{
// Triggered via Animation Event at the exact swing frame
weaponCollider.enabled = true;
// Temporarily allow animation-driven motion
animator.applyRootMotion = true;
}
public void CloseHitbox()
{
weaponCollider.enabled = false;
// Return full control to the physics system
animator.applyRootMotion = false;
}