Game Toolkit for Unity
Learn more about animation machines and what you can use them for.
Animation machines are Unity components that are added to game objects. They’re mostly used in relation with animator components or joints, e.g. to react on animator IK updates or breaking joints on a game object.
An animation machine component can be added through the components menu (Makinom > Machines > Animation Machine) or the scene wizard (Add Machine > Animation Machine). A game object with an animation machine is represented in the Unity scene view by this gizmo icon:
You can learn more about machine components in general and their basic settings here.
An animation machine is started by animation callback functions.
Started by animator components immediately before it updates its internal IK (inverse kinematics) system. It’s implemented in the component’s OnAnimatorIK function.
This start type will automatically initialize the following local variables.
The Animator IK start type can optionally check the layer index the OnAnimatorIK function was called from. This can be used to e.g. only start the machine when coming from a specific layer.
This start type can be used to set the positions of the IK goals and their respective weights. Use an Animator Weight node to set the position and weight of IK goals.
Started by animator components each frame after the state machines and the animations have been evaluated, but before Animator IK. It’s implemented in the component’s OnAnimatorMove function.
This start type can be used to move a game object based on root motion. Use a Store Parameter node to store parameters from an animator controller into variables and use them in one of the various Movement nodes (e.g. a Move node) to move the game object.
Started when a joint attached to the machine’s game object broke. It’s implemented in the component’s OnJointBreak function. When a force that is higher than the breakForce of the joint, the joint will break off.
The Joint Break start type can optionally check the break force the OnJointBreak function was called with. This can be used to e.g. only start the machine when the break force is between two defined values.
This start type can be used to animate the breaking of a joint. Use a Play Sound node to play an audio clip or spawn a particle effect prefab with a Spawn Prefab node.
Started when receiving an UI or animation event with no parameter.
Animation events are added to animations – select the AnimationEvent ( ) function in the animation event.
UI events are added to UI components, e.g. add it as an event to the On Click () event list of a Button component by selecting the AnimationMachineComponent > AnimationEvent () function.
This start type can be used to play sounds at specific points in an animation. Use a Play Sound node to play an audio clip.
Started when receiving an UI or animation event with an int parameter.
Animation events are added to animations – select the AnimationEventInt ( int ) function in the animation event.
UI events are added to UI components, e.g. add it as an event to the On Click () event list of a Button component by selecting the AnimationMachineComponent > AnimationEventInt (int) function.
The Animation Event (int) start type can optionally check the int parameter that was used by the animation event. This can be used to e.g. only start the machine when the parameter is between two defined values.
Started when receiving an UI or animation event with a float parameter.
Animation events are added to animations – select the AnimationEventFloat ( float ) function in the animation event.
UI events are added to UI components, e.g. add it as an event to the On Click () event list of a Button component by selecting the AnimationMachineComponent > AnimationEventFloat (float) function.
The Animation Event (float) start type can optionally check the float parameter that was used by the animation event. This can be used to e.g. only start the machine when the parameter is between two defined values.
Started when receiving an UI or animation event with a string parameter.
Animation events are added to animations – select the AnimationEventString ( String ) function in the animation event.
UI events are added to UI components, e.g. add it as an event to the On Click () event list of a Button component by selecting the AnimationMachineComponent > AnimationEventString (string) function.
The Animation Event (string) start type can optionally check the string parameter that was used by the animation event. This can be used to e.g. only start the machine when the parameter contains a defined text.
Started when receiving an UI or animation event with a game object parameter – the game object will be used as the starting object.
Animation events are added to animations – select the UIGameObject ( GameObject ) function in the animation event.
UI events are added to UI components, e.g. add an event to the On Click () event list of a Button component by selecting the AnimationMachineComponent > UIGameObject (GameObject) function.