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

Perpendicular#

Math / Perpendicular

  • Can Read

  • Cannot Write

Description#

Returns a direction vector perpendicular to a given vector

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]
    
    [Title("Perpendicular")]
    [Category("Math/Perpendicular")]
    [Description("Returns a direction vector perpendicular to a given vector")]
    
    [Image(typeof(IconAngleRight), ColorTheme.Type.Yellow)]
    [Keywords("Vector", "Orthogonal", "Right", "90")]
    
    [Serializable]
    public class TypeVector2MathPerpendicular : TypeVector2
    {
        [SerializeField] private GetVector2 m_Direction = new GetVector2();

        public override Vector2 GetPreview(GameObject source) => Vector2.Perpendicular(this.m_Direction.GetPreview(source));

        public override Vector2 Get(Args args)
        {
            return Vector2.Perpendicular(this.m_Direction.Get(args));
        }
        
        public override string ToString()
        {
            return $"Perpendicular of {this.m_Direction}";
        }
        
        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.