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

Game Object Name#

Game Object / Game Object Name

Description#

Compares a Game Object name with another value

Parameters#

Name Description
Game Object The Game Object targeted
Name The value to compare against

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Game Object Name")]
    [Image(typeof(IconCubeOutline), ColorTheme.Type.TextLight)]
    
    [Description("Compares a Game Object name with another value")]
    [Category("Game Object/Name")]
    
    [Parameter("Game Object", "The Game Object targeted")]
    [Parameter("Name", "The value to compare against")]
    
    [Serializable]
    public class ConditionCoreGameObjectCompareName : Condition
    {
        [SerializeField] private GetGameObject m_GameObject = new GetGameObject();
        [SerializeField] private GetString m_Name = new GetString();

        protected override string GetTitle(GameObject source) => $"{this.m_GameObject} Tag = {this.m_Name}";

        protected override bool Run(Args args)
        {
            GameObject gameObject = this.m_GameObject.Get(args);
            string tag = this.m_Name.Get(args);
            
            return gameObject != null && gameObject.name == tag;
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.