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

Compare Vector2#

Compare / Compare Vector2

Description#

Returns true if two Vector2s are equal

Parameters#

Name Description
Value 1 The Vector2 targeted
Value 2 The Vector2 to compare against

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Compare Vector2")]
    [Image(typeof(IconVector2), ColorTheme.Type.Lime)]
    
    [Description("Returns true if two Vector2s are equal")]
    [Category("Compare/Compare Vector2")]
    
    [Parameter("Value 1", "The Vector2 targeted")]
    [Parameter("Value 2", "The Vector2 to compare against")]
    
    [Keywords("Check", "Equals", "Same")]
    
    [Serializable]
    public class ConditionCoreCompareVector2 : Condition
    {
        [SerializeField] private GetVector2 m_Value1 = new GetVector2();
        [SerializeField] private GetVector2 m_Value2 = new GetVector2();

        protected override string GetTitle(GameObject source) => $"{this.m_Value1} = {this.m_Value2}";

        protected override bool Run(Args args)
        {
            Vector2 value1 = this.m_Value1.Get(args);
            Vector2 value2 = this.m_Value2.Get(args);
            
            return value1 == value2;
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.