Skip to content

Logic Animator

Henry de Jongh edited this page Mar 17, 2023 · 3 revisions
Description Icon
A reactive logic component that can control a Unity Animator component.

Parameters

Name Description
Animator The Unity animation system component.

Inputs

Name Description Parameter
Play Plays a state whose name is passed by the string parameter. The name of the parent layer should be included when specifying a state name. For example, if you have a Bounce state in the Base Layer, the name would be Base Layer.Bounce. state (string) The optional (recommended) layer and required name of the state.
SetSpeed Sets the playback speed of the animator to the float parameter. speed (float) The playback speed of the animator; where 1.0 is normal playback.
SetParam:[Name] Sets the animator parameter to the given parameter. parameter (string) The parameter that was passed to the input.
SetParamDamping:[Name] Sets the damping applied to animator parameter changes. damping (float) The damping to be used on changes to this parameter, this roughly corresponds to the number of seconds.
SetLayerWeight:[Name] Sets the animator layer weight to the given parameter. weight (float) The weight of the layer between 0.0 and 1.0.
SetLayerOffset:[Name] Sets the normalized playback offset of the animator layer to the float parameter between zero and one. offset (float) The playback offset between 0.0 and 1.0.
SetLayerOffsetSeconds:[Name] Sets the playback offset of the animator layer to the float parameter in seconds. seconds (float) The playback offset in exact seconds.

Outputs

Name Description Parameter
None None None

Unity Animator Tips

Root Motion

Animations set things to a specific value. For example, a motion animation might start position.x at 0 and move it to 1 over the course of the animation, but then when the animation loops it will set it back to 0 and teleport back to the start.

Apply Root Motion changes any motion that would normally be applied to the root object to be additive instead. So if your position.x is at 4 and you play this animation, it will add the motion so that it goes to 5, then 6, then 7 and not jump back to the start value when it loops.

Local Space

Animation positions are in world space. Simply place the animated object inside an empty parent. The animation will then be positioned in the parent's coordinate space, and you can move the parent to reposition the visible object.

Clone this wiki locally