Unity 3D Game Engine – Blend Tree
Blend Tree is useful to mix two or more Animations, for example if you have animation for ‘Running Left’ ‘Running Right’ ‘Runing Foward’ ‘Running Backward’.
1. Animator Window> RMB over an empty space> Create a State> From New Blend Tree>
2. Inspector> inside Motion Slot you will see ‘Blend Tree’ NOT a single Animation!
3. Animator Window> double click ‘Blend Tree’> Inspector:
– Name of Blend Tree
– Blend Type:
— 1D (one dimensional), it uses a single parameter, for example ‘Speed’ (value from 0 to 1)
Usa un parametro singolo per gestire l’animazione
— 2D Simple Directional, it use direction to make transitions
Usa una animazione per ogni direzione, ad esempio walkfoward walkbackward walkleft walkright
— 2D Freeform Directional, it use direction to make transitions
Usa più animazioni per la stessa direzione, ad esempio walkfoward walkbackward walkleft walkright + runfoward runbackward runleft runright
— 2D Freeform Cartesian, it use direction to make transitions
– Motion> ‘+’:
— Add Motion Field
-> DRAG AND DROP an Animation, for example ‘Run’
-> DRAG AND DROP an Animation, for example ‘Walk’
-> DRAG AND DROP an Animation, for example ‘Sneak’
or
-> click over the small circle icon
— New Blend Tree, to add nested Blend Trees (nidificati)
4. Inspector> Play animation preview and change Animator Window> Blend Tree level> Speed slide you will see:
– Speed 0 -> Run
– Speed 0.5 -> Walk
– Speed 1 -> Sneak
5. Inspector> Use the handle in the left to DRAG UP or DOWN the Motion Slots to change animations order.
– Automate Threshold (soglia):
– check it to automate threshold (crea un’interpolazione automatica)
– uncheck
— Speed
— Velocity X / Y / Z
— Angular Speed Rad / Grad
– Adjust Time scale
— Homogeneous Speed
— Reset Time Scale