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 Vector3

  • 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", "Vector3")]
    [Description("Returns the positive angle in degrees between two vectors")]
    
    [Image(typeof(IconAngleAcute), ColorTheme.Type.Yellow)]
    [Keywords("Vector", "Alpha")]
    
    [Serializable]
    public class TypeNumberMathVector3Angle : TypeNumber
    {
        [SerializeField] private GetVector3 m_From = new GetVector3();
        [SerializeField] private GetVector3 m_To = new GetVector3();

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

        public override double Get(Args args)
        {
            return Vector3.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.