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

Set Playable Director Wrap Mode#

Timeline / Playable Director / Set Playable Director Wrap Mode

Description#

Changes what the Playable Director does when it reaches the end of its Playable Asset

Parameters#

Name Description
Playable Director The Playable Director component changed
Wrap Mode Hold keeps the last frame, Loop starts over and None stops

Code#

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

namespace VisualScript.Runtime
{
    [Title("Set Playable Director Wrap Mode")]
    [Category("Timeline/Playable Director/Wrap Mode")]
    [Description("Changes what the Playable Director does when it reaches the end of its Playable Asset")]

    [Image(typeof(IconDirector), ColorTheme.Type.Teal)]
    [Keywords("Timeline", "Cutscene", "Cinematic", "Sequence", "Loop", "Hold", "Extrapolation")]

    [Parameter("Playable Director", "The Playable Director component changed")]
    [Parameter("Wrap Mode", "Hold keeps the last frame, Loop starts over and None stops")]

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

        [SerializeField] private DirectorWrapMode m_WrapMode = DirectorWrapMode.None;

        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Wrap Mode");
            return $"{this.m_PlayableDirector} {member} = {this.m_WrapMode}";
        }

        protected override Awaitable Run(Args args)
        {
            PlayableDirector director = this.m_PlayableDirector.Get<PlayableDirector>(args);
            if (director == null) return Done;

            director.extrapolationMode = this.m_WrapMode;
            return Done;
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.