Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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");
}
 
PREVIOUS NEXT
Tagged: #object #tag #exists #unity
ADD COMMENT
Topic
Name
3+2 =