Unity 3D Game Engine – Animator Controller
Animator Controller
Animator Controller is a ‘state machine’, it is used to mix and blend animations.
Animations are stored inside blocks and you can drive blocks using parameters, parameters are changed by scripts.
The workflow is:
Character GameObject -> Animator Component -> Animator Controller (it is used to define animation clips) -> Animations -> Parameters -> Scripts
-> Avatar (it is used to define rigs and skeleton)
It is said that it is complicated but very useful to make realtime-interactive animations, let’s go on!
1. Select a 3D Model> Inspector> ‘Add Component’> Miscellaneus> Animator (prima di tutto creo Animator Component)
2. Project> RMB> Create> Animator Controller, give it a name
3. DRAG AND DROP Animator Controller over Hierarchy> Inspector> Animator Component> Controller
4. Double LMB over Animator Controller will opes Animator window
Animations
They are the animation clips
5. Project> DRAG AND DROP Animations over Animator Window, example ‘Idle’ (poltrire) and ‘Run’ (correre) animation
6. RMB over your default animation block> Set As default, example ‘Idle’
7. Animator Window> select your animation ‘Idle’> Inspector>
– Speed = 1 to run animation at normal speed, 2 to doble speed etc…
– Motion: the motion clip
– Foot IK: check it to reduce or remove foot slipping (elimina lo slittamento dei piedi)
– Mirror: it flips the animation left to right
– Transitions: list of transitions for this animation
Parameters
Parameters are used to manage behaviours and to take decisions, they can be:
– Float
– Int
– Bool
– Trigger
8. Animator Window> Bottom Left> Parameters> ‘+’> Float> create ‘Speed’ parameter.
Transitions
Transitions lets you move smootly from an animation to another.
9. Animator Window> RMB over ‘Idle’ Box> Make Transition> LMB over ‘Run’ Box
10. LMB over the Transition Arrow
11. Inspector, bottom, Play the Preview of transition
12. Inspector>
– Mute: stop the effect transition, use it for debug pourpuse only, uncheck for build the executable
– Solo: stop the effect of transition that comes from the same state, use it for debug pourpuse only, uncheck for build the executable
– Give a name
– Atomic: check -> the transition is not interruptible by other transitions
– DRAG the Transition Blocks
– Conditions