Layer Multiple Animations on One Entity Simultaneously
Understand Animation Layers
GeckoLib supports running multiple animations at the same time on different parts of a model. This lets you play an idle animation on the body while the head looks around, or attack with arms while legs walk.
Set Up Multiple Animation Controllers
In your entity's registerControllers() method, add more than one animation controller. Each controller can manage a different set of bones or animation states. Name them distinctly (e.g., "body_controller", "head_controller") so they don't conflict.
Assign Bones to Each Controller
In your Blockbench model, organize bones into logical groups. When creating animations, target specific bone hierarchies. GeckoLib will blend animations from different controllers—if one controller animates the legs and another animates the arms, both play together without overriding each other.
Test Layering
Trigger different animations on each controller simultaneously in-game. Adjust animation priorities or blending if one animation dominates another unexpectedly. Use event keyframes to synchronize animations across layers when needed.