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

Gizmo Ray#

Debug / Gizmos / Gizmo Ray

Description#

Displays a ray gizmo from a position along a direction in the scene

Parameters#

Name Description
Position The position where the ray starts
Direction The direction and length of the ray
Color The color of the ray
Duration The amount of seconds the ray will be displayed

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Gizmo Ray")]
    [Image(typeof(IconLineStartEnd), ColorTheme.Type.Lime, typeof(BadgeExitRight))]

    [Description("Displays a ray gizmo from a position along a direction in the scene")]
    [Category("Debug/Gizmos/Ray")]

    [Parameter("Position", "The position where the ray starts")]
    [Parameter("Direction", "The direction and length of the ray")]
    [Parameter("Color", "The color of the ray")]
    [Parameter("Duration", "The amount of seconds the ray will be displayed")]

    [Keywords("Draw", "Debug", "Gizmo", "Direction")]

    [Serializable]
    public class InstructionCoreDebugGizmoRay : Instruction
    {
        [SerializeField] private GetVector3 m_Position = new GetVector3();
        [SerializeField] private GetVector3 m_Direction = new GetVector3(Vector3.forward);
        [SerializeField] private GetColor m_Color = new GetColor(Color.green);
        [SerializeField] private GetNumber m_Duration = new GetNumber(1f);

        protected override string GetTitle(GameObject source) => $"Display Ray at {this.m_Position}";

        protected override Awaitable Run(Args args)
        {
            GizmosManager.Ray(
                this.m_Position.Get(args),
                this.m_Direction.Get(args),
                this.m_Color.Get(args),
                this.m_Duration.GetFloat(args)
            );

            return Done;
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.