Animation Sync Issues
Scenario: The player has a sword attack animation. Visually the sword swings through an enemy, but no damage is dealt. The attack hitbox (Area3D) is supposed to activate mid-swing and deactivate after the swing. The timing seems correct in the animation timeline editor, but hits are not registering.
Setup
Player/AnimationPlayer: has anattackanimation, 0.6 seconds longPlayer/WeaponPivot/HitArea:Area3Dwithmonitoringtoggled by the animation- The animation should set
monitoring=trueat 0.1s andmonitoring=falseat 0.4s - Enemy
Area3Dis set tomonitorable=true
Step 1: Record an attack sequence
Click Start Recording in the Spectator dock, perform 5-6 attacks against an enemy, including some that visually connect, then click Stop Recording.
Step 2: Find frames where the attack should land
Step 3: Check hitbox timing
Step 4: Verify the keyframe data
Step 5: Fix the animation keyframes
Step 6: Verify
Key takeaways
- Property condition filtering (
property_equals: current_animation: attack) isolated exactly the frames of interest across a 2,400-frame recording in one call. - Frame-by-frame animation position tracking revealed the hitbox was activating 330ms late — impossible to see from code, easy to see from spatial data.
- Animation bugs often come from speed_scale testing. If you test at half speed and set keyframes by feel, then reset speed_scale, all your keyframe times are effectively doubled.
- Use
clips+spatial_inspecttogether. The clips query found the timing anomaly; the scene read confirmed the actual keyframe values. Both were needed.