Undefined Tag#

Tag: Example is not defined.

Individual GameObjects have tags that can be used to identify them.
Tags are defined in the Tags and Layers Settings (EditProject SettingsTags and Layers).
Tags are not the same as Layers, and don't affect rendering or collision.

If you're seeing this error you have either not defined one in the first place, or haven't identically referenced an existing tag.


Identical includes capitalisation and spaces


Define an identical tag in the Tags and Layers Settings and apply it to the GameObject that is being referenced.

Tag Dropdown

If the error still appears, ensure the console has been cleared. Then log the GameObject and its tag before the CompareTag call to validate your logic. See Logging: how-To for more information.