Animation in Unity isn't just about playing and stopping animations. It's a complete system for controlling character movement, blending animations, and creating complex behaviours.
Core Animation Controls:
Play/Stop: Basic playback controls
SetBool/SetTrigger/SetFloat: Tell animator when to change states
GetBool/GetTrigger: Check current animation conditions
Speed: Control animation playback speed
Animation Clips:
Add/Remove clips at runtime
Set frameRate for timing control
Legacy vs Mecanim system compatibility
AddClip for dynamic animation loading
Animation Events:
Trigger functions at specific animation frames
Set exact time for event triggers
Useful for footsteps, attack hits, sound effects
Add custom function calls during animations
Inverse Kinematics (IK):
SetIKPosition: Place hands/feet precisely
SetIKRotation: Control limb orientation
SetIKPositionWeight: Blend between IK and animation
Essential for dynamic interaction with environment
Animation Layers:
SetLayerWeight: Control animation mixing
CrossFade: Smooth transitions between states
Multiple animations playing simultaneously
Blend different body parts independently
Root Motion:
ApplyRootMotion: Use animation for character movement