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

On Trigger Stay 3D#

Physics 3D / On Trigger Stay 3D

Description#

Executed while a game object stays inside a collider marked as trigger

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("On Trigger Stay 3D")]
    [Image(typeof(IconCubeOutline), ColorTheme.Type.Lime, typeof(BadgeDot))]
    
    [Description("Executed while a game object stays inside a collider marked as trigger")]
    [Category("Physics 3D/On Trigger Stay")]
    
    [Keywords("Collider", "Trigger")]

    [Serializable]
    public class TriggerCoreTriggerStay3D : TriggerHandleSourceBase<HandleOnTriggerStay3D>
    {
        // EXPOSED MEMBERS: -----------------------------------------------------------------------

        [SerializeField]
        private TValueOrAny<GetGameObject> m_Target = new TValueOrAny<GetGameObject>();
        
        // PROPERTIES: ----------------------------------------------------------------------------

        protected override string GetTitle(GameObject source) => $"{this.SourceName} Trigger Stay {this.m_Target}";

        // OVERRIDE METHODS: ----------------------------------------------------------------------
        
        protected override void OnTrigger(GameObject target)
        {
            using Args args = Args.Get(this.Component, target);
            if (this.m_Target.IsSpecific && this.m_Target.Value.Get(args) != target) return;
            
            this.Run(args);
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.