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

Cancel Event#

Control / Cancel Event

Description#

Cancels the execution of an Event

Parameters#

Name Description
Event The Event component to cancel

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Cancel Event")]
    [Image(typeof(IconInstructions), ColorTheme.Type.Red, typeof(BadgeBolt))]
    
    [Description("Cancels the execution of an Event")]
    [Category("Control/Cancel Event")]
    
    [Parameter("Event", "The Event component to cancel")]
    
    [Keywords("Stop", "Exit", "Cancel", "Event")]
    
    [Serializable]
    public class InstructionCoreCancelEvent : Instruction
    {
        [SerializeField] private GetGameObject m_Event = new GetGameObject(
            new TypeGameObjectComponentEvent()
        );

        protected override string GetTitle(GameObject source) => $"Cancel {this.m_Event}";

        protected override Awaitable Run(Args args)
        {
            Event eventComponent = this.m_Event.Get<Event>(args);
            eventComponent.Stop();
            
            return Done;
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.