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

Angle#

Math / Geometry / Angle Vector2

  • Can Read

  • Cannot Write

Description#

Returns the positive angle in degrees between two vectors

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]
    
    [Title("Angle")]
    [Category("Math/Geometry/Angle", "Vector2")]
    [Description("Returns the positive angle in degrees between two vectors")]
    
    [Image(typeof(IconAngleAcute), ColorTheme.Type.Yellow)]
    [Keywords("Vector", "Alpha")]
    
    [Serializable]
    public class TypeNumberMathVector2Angle : TypeNumber
    {
        [SerializeField] private GetVector2 m_From = new GetVector2();
        [SerializeField] private GetVector2 m_To = new GetVector2();

        public override double GetPreview(GameObject source) => Vector2.Angle(this.m_From.GetPreview(source), this.m_To.GetPreview(source));

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