Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Playable Director State#

Timeline / Playable Director / Playable Director State

Description#

Returns true if the Playable Director is in the chosen play state

Parameters#

Name Description
Playable Director The Playable Director component checked
State Playing while the Playable Director runs, Paused while it is paused or stopped

Code#

using System;
using UnityEngine;
using UnityEngine.Playables;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Playable Director State")]
    [Category("Timeline/Playable Director/State")]
    [Description("Returns true if the Playable Director is in the chosen play state")]

    [Image(typeof(IconDirector), ColorTheme.Type.Teal)]
    [Keywords("Timeline", "Cutscene", "Cinematic", "Sequence", "Playing", "Paused")]

    [Parameter("Playable Director", "The Playable Director component checked")]
    [Parameter("State", "Playing while the Playable Director runs, Paused while it is paused or stopped")]

    [Serializable]
    public class ConditionPlayableDirectorState : Condition
    {
        [SerializeField] private GetGameObject m_PlayableDirector = new GetGameObject(
            new GenTypeGameObject_PlayableDirector()
        );

        [SerializeField] private PlayState m_State = PlayState.Playing;

        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("State");
            return $"{this.m_PlayableDirector} {member} is {this.m_State}";
        }

        protected override bool Run(Args args)
        {
            PlayableDirector director = this.m_PlayableDirector.Get<PlayableDirector>(args);
            return director != null && director.state == this.m_State;
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.