Getting a int tag

I have a gameObject with a child that has a tag 0 and another 1. i want to check if the child tag = 0 like this but am getting error, how can i do this please ?

Thank you.

    			if(gameObject.transform.GetChild(0).tag == 0)
    			{
    				Debug.Log ("T0");
    			}

Try putting “” around the 0 in …tag == 0 to have it interpreted as a string.
Like this:

if(gameObject.transform.GetChild(0).tag == "0")
		{
			Debug.Log ("T0");
		}

Hope this helps!

-Cole

Tags are all strings.

Therefore, the “0” and “1” you’re using are not equivalent to the integers they appear to be, but are instead their character equivalents.

If you absolutely insist on trying to represent the tags as integers as best as possible, you could potentially utilize .ToString().

Thanks guys got it working :).