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

Wait for Frames#

Control / Wait for Frames

Description#

Waits for the specified amount of frames

Parameters#

Name Description
Frames The amount of frames to wait

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Wait for Frames")]
    [Image(typeof(IconTimer), ColorTheme.Type.Blue)]
    
    [Description("Waits for the specified amount of frames")]
    [Category("Control/Wait for Frames")]
    
    [Parameter("Frames", "The amount of frames to wait")]
    
    [Keywords("Hold", "Pause", "Idle")]
    
    [Serializable]
    public class InstructionCoreWaitForFrames : Instruction
    {
        [SerializeField] private GetInteger m_Frames = new GetInteger(1);

        protected override string GetTitle(GameObject source) => $"Wait {this.m_Frames} frames";

        protected override async Awaitable Run(Args args)
        {
            int frames = (int) this.m_Frames.Get(args);
            for (int i = 0; i < frames; ++i)
            {
                await this.NextFrame();
            }
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.