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 Bools#

Compare / Compare Bools

Description#

Returns true if two Booleans are equal

Parameters#

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

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Compare Bools")]
    [Image(typeof(IconToggleOn), ColorTheme.Type.Red)]

    [Description("Returns true if two Booleans are equal")]
    [Category("Compare/Compare Bools")]

    [Parameter("Value 1", "The Boolean targeted")]
    [Parameter("Value 2", "The Boolean to compare against")]

    [Keywords("Check", "Equals", "Same")]

    [Serializable]
    public class ConditionCoreCompareBool : Condition
    {
        [SerializeField] private GetBool m_Value1 = new GetBool();
        [SerializeField] private GetBool m_Value2 = new GetBool();

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

        protected override bool Run(Args args)
        {
            bool value1 = this.m_Value1.Get(args);
            bool value2 = this.m_Value2.Get(args);

            return value1 == value2;
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.