Answers for "how to know if object with a certain tag exists unity c#"

C#
0

how to know if object with a certain tag exists unity c#

void Update()
{
	string thisTag = "ExampleTag";
  	GameObject someObject = GameObject.FindGameObjectWithTag(thisTag);
  	if(someObject != null) Debug.Log("Object With This Tag Exists");
    else Debug.Log("No Object With This Tag Exists Currently");
}
Posted by: Guest on April-30-2022

Code answers related to "how to know if object with a certain tag exists unity c#"

C# Answers by Framework

Browse Popular Code Answers by Language