How to get an object's Tag? (Not as a string but as the Tag class)

‘gameObject.tag’ will return the GameObject’s tag as a string, but I’d like to know how to get an object’s tag in the form of the actual Tag class. Does anyone know how to do this easily?

I am unfamiliar with this class. Can you direct me to the documentation?

Hmmm… weird, I cannot find the documentation, yet I’m definitely able to create a variable of type Tag in C#. Making it a public variable creates a dropdown in the Inspector that lets you select a tag.

Wait never mind, I had some plugin installed that created a custom Tag class that was basically just a string. My bad haha, thanks for the help anyway

1 Like