Mecanim
RunTime
Animator
Avatar
Controller
private Animator anim;
void
Awake(){ ... }
anim = this.transform.GetComponent<Animator>()
//link between character and in game property/state update
Update(){ ... }
float horizontal = Input.GetAxis("Horizontal");
float vertical = Input.GetAxis("Vertical");
anim.SetFloat("Speed", vertical, 0.15f, Time.deltaTime);
anim.SetFloat("Direction", horizontal, 0.15f, Time.deltaTime);
Animator Controller
State Machine
Layers
Base
Arms
Name
"Arms"
Weight
Blending
Override
Additive
Mask
Avatar
Transforms
Blend Trees
Type
1D
Motions
2D
Simple Directional
//simple dir : walk forward, walk left, walk right
Freeform Directional
//complex dir : walk forward => run forward, walk left => run left ...etc
Freeform Cartesian
//not mapped to direction
Direct
???
States
type
Default
//state that the machine will be in when it is first activated
Any
Anonymous Starting Point
//Always present. It exists for the situation where you want to go to a specific state regardless of which state you are currently in. This is a shorthand way of adding the same outward transition to all states in your machine
//Cannot be the end point of a transition (ie, jumping to "any state" cannot be used as a way to pick a random state to enter next
var
Prop
Name
"idle"
Tag
???
Motion
Transitions
NOTE:
If clips are from mixxed rigs; no animation will run
ex : Idle == Humanoid, crouch==Generic
Parameters
//global for all layers
Bool
HoldingPushable
HoldingPickup
Trigger
Like Bool, but reverts to back to true after triggered
Floats
Curves
From Animation Clip
"rootSpeedWalk"
Apply Root Motion
Handled by Script
rootmotion.cs
[RequireComponent(typeof(Animator))]
void OnAnimatorMove(){ ... }
Animator animator = GetComponent<Animator>();
Vector3 newPosition = transform.position ;
newPosition.z += animator.GetFloat("rootSpeedWalk") * Time.deltaTime
transform.position = newPosition;
Animate Physics
Culling Mode
Always Animate
Based On Renders
Source
Import
Settings
New in 5.0
StateMachine
Transitions
enter/exit node
enter
random idle(5)
exit
Behaviours
Not just animation
Statemachine can be used for logic
Root Motion
authoring
takes animClip absolute to additive for root ???
Asset creation/editing API
Direct BlendTree
2D Blend Tree
move
data
Up
Side
script for sprite logic
BlendShape
array
1 frame animatoin
parameter to control them
GUI
Layers
re-order
Properties
Clear up
other
IK
roll
mocap
multiweight
Transition
interruption improvements
based on destination state + start/destination
not just start
Linear velocity blending
GameObject
Animator
Avatar
Features
Easy workflow and setup of animations on humanoid characters.
Animation retargeting - the ability to apply animations from one character model onto another.
Avatar?
.ht
Human Template?
Simplified workflow for aligning animation clips.
Convenient preview of animation clips, transitions and interactions between them. This allows animators to work more independently of programmers, prototype and preview their animations before gameplay code is hooked in.
Management of complex interactions between animations with a visual programming tool.
Animator Controller
Finite State Machine?
BlendTrees
Animating different body parts with different logic.
Body Mask?