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

Max#

Math / Max

  • Can Read

  • Cannot Write

Description#

Returns a vector that is made from the largest components of two vectors

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]
    
    [Title("Max")]
    [Category("Math/Max")]
    [Description("Returns a vector that is made from the largest components of two vectors")]
    
    [Image(typeof(IconGreaterThan), ColorTheme.Type.Yellow)]
    [Keywords("Vector")]
    
    [Serializable]
    public class TypeVector3MathMax : TypeVector3
    {
        [SerializeField] private GetVector3 m_VectorA = new GetVector3();
        
        [SerializeField] private GetVector3 m_VectorB = new GetVector3();

        public override Vector3 GetPreview(GameObject source) =>
            Vector3.Max(this.m_VectorA.GetPreview(source), this.m_VectorB.GetPreview(source));

        public override Vector3 Get(Args args)
        {
            return Vector3.Max(
                this.m_VectorA.Get(args),
                this.m_VectorB.Get(args)
            );
        }
        
        public override string ToString()
        {
            return $"Max ({this.m_VectorA}, {this.m_VectorB})";
        }
        
        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.