The Problem
This week, I discovered a stubborn issue in our enemy melee system that completely broke the combat loop. Whenever an enemy triggered its melee attack animation, the animation would play correctly—but it never exited. Instead, the enemy would get stuck in a repeating cycle where the attack montage fired endlessly. The AI continued moving normally, so enemies would slide around the map while machine-gunning punches into the air. Funny the first time, unacceptable for gameplay.
The core problem was that the animation system believed the enemy was still performing a ranged attack, even though ranged combat hadn’t been implemented yet. A boolean inside the animation instance (isRangedAttacking) was being set when the shared attack animation began, but because there’s no ranged pipeline in place yet, the notify that should have cleared that flag never fired. With the boolean stuck on “true,” the animation state machine locked itself into a loop.
The Solution – “Unwiring the Ghost Notify”
Once I traced the issue back to that stale boolean, the fix became clear. I separated melee and ranged attack states, rewired the animation notifies so that attack completion is always reported regardless of which animation version is used, and ensured that the animation instance properly resets all attack flags when the montage ends.
After correcting the notify and boolean logic, the enemies finally returned to their normal behavior flow—attack, recover, and continue through the behavior tree as intended.
While solving this, I also improved our ability to debug melee collisions. Since team affiliation wasn’t fully implemented yet, it was hard to confirm whether hit windows were firing correctly visually. I added two console-callable debug tools:
• one that draws the melee hit shapes and timing windows directly in-world, and
• one that repeatedly pulses the collision logic so impact behavior can be tested even without enemy motion.
These tools took all the guesswork out of tuning the collision timings and validating the melee component’s behavior.
With the animation notify fixed and the debug tooling in place, the melee system is far more stable, predictable, and easier to tune as we continue refining combat for Ryssa Through Time.
