Play Single Clip Nodes
Animation controller graphs provide multiple node types that are used for sampling animation clips. The play single clip node is the most basic one. This node samples an animation clip and outputs the respective animation pose. It is thus used for typical playback of a single animation either once or in a loop. For added variety you may reference multiple animation clips, in which case the node will randomly pick one of them for playback.
All animation controller nodes that sample animation clips share these properties:
Loop: If enabled the node will loop playback while its
Activepin is triggered. Which clip exactly gets looped depends on the node. The play single clip node for example just loops playback in general, but randomly picks a different clip in every iteration. The play clip sequence node on the other hand will loop its middle clip instead.
PlaybackSpeed: Adjusts the speed with which the animations are sampled.
FadeOut: The time (in seconds) that it should take to fade an animation in and out. If this is set to
0, the animation will immediately switch on or off when the node gets (de-)activated. If the time is non-zero, the animation will gradually fade in or out over this duration. These values are very important to cross-fade from one animation to another. For example, if a character is playing an idle animation and then should transition to walk, the walk animation should have a short fade in duration and the idle animation should have a fade out duration. The shorter of the two durations determines how long the two animations are being cross-faded to transition smoothly from one state to the other.
Additionally, if the fade in and out values are longer than the animation itself, the animation will be forced to play back for that amount of time, typically by extending the use of the last keyframe. This can be very useful if you use an animation that only contains a static pose, for example a pose for aiming. With a
FadeInof 200ms this single pose will be held for 200ms but gradually faded in. That leads to a character slowly raising their hand, instead of immediately having the hand raised. The same is true for the
FadeOutproperty, which again can be used to slowly lower the hand by fading out the aim pose over a longer duration.
ImmediateFadeOut: The playback starts when the
Activepin is triggered. If
ImmediateFadeOutis off, the clip will be played back to its very end before it is allowed to fade out. If
ImmediateFadeOutis on, however, the animation will be faded out right away when the
Activepin stops being triggered. If
ImmediateFadeInis off, once a node starts fading out, it will continue fading out until it is fully off, no matter what the
Activepin state is. If
ImmediateFadeInis on, a node that has started fading out may immediately fade in again if the
Activepin gets triggered again.
These values determine how responsive animation playback is in regards to input changes. Immediately fading in and out can drastically reduce delay between input and a visual reaction, but may also only work well with certain animations.
Clips: One or multiple animation clips to play. If more than one is added, the node will pick one at random in every loop iteration.
Common Input Pins
Many animation controller nodes have some or all of these input pins:
Active: This pin determines whether the node samples its animation clips at all. Once it gets triggered in a frame, the node starts to sample its animation clips, fades them in etc. If
Loopis enabled, the playback will repeat as long as the
Activepin is triggered. Once the pin is not triggered anymore, the node will start to fade out its animations. Either right away (
ImmediateFadeOuton) or when it reaches the end of the currently playing clip (
Weights: If this pin is connected to a bone weight node, then the sampled animation clip is only applied to that part of the character. This is used to limit playback of an animation to selected body parts.
Speed: This pin adjusts the overall playback speed.
ClipIndex: If the node has multiple
Clipsset, exactly which one will be played back can be controlled through this pin. With
0the first clip is used exclusively, with
1only the second clip is used, and so on. If
ClipIndexis not connected or set to a negative value, a random clip is used.
Common Output Pins
Many animation controller nodes have some or all of these output pins:
OnFadeOut: This pin gets triggered for a single frame once the node changes its internal state to fade out the animation (affected by
FadeOut). This is typically a good time to start fading in another animation to take over. This pin is guaranteed to get triggered, even if the
FadeOuttime is zero.