ZenCoder Tips & Tricks: Animation & Timeline¶
With ZenCoder, you can debug animations, control playback, override blend states, or run timeline sequences - all without recompiling or touching Animator Controllers or Timeline assets.
It’s perfect for quickly testing transitions, previewing animation blending, live-tweaking parameters, or syncing cutscenes in real-time.
💡 Important: Most tips require you to select the right target component like
Animator,PlayableDirector, or a custom animation script.
Pause & Resume Timeline Playback¶
Component: PlayableDirector
public void Start()
{
if (target.state == UnityEngine.Playables.PlayState.Playing)
target.Pause();
else
target.Resume(); // Use Resume() if you're calling Pause mid-sequence
}
Set a Trigger at Runtime¶
Component: Animator
Read Current Animator State Name¶
Component: Animator
public void Start()
{
var info = target.GetCurrentAnimatorStateInfo(0);
Debug.Log("Current state: " + info.shortNameHash);
}
Debug Timeline Track Bindings¶
Component: PlayableDirector
public void Start()
{
foreach (var kvp in target.playableAsset.outputs)
{
Debug.Log("Track: " + kvp.streamName + " -> " + target.GetGenericBinding(kvp.sourceObject));
}
}
Create a Custom Timeline Binding on the Fly¶
Component: PlayableDirector