Search Unity

Unity 2017.1 build app CompareTag fails silently when empty tags are present in TagManager.

Discussion in 'Editor & General Support' started by svenneve, Aug 4, 2017.

  1. svenneve

    svenneve

    Joined:
    May 14, 2013
    Posts:
    80
    We use tags to see what terrain type a character is walking is on, we however had this odd bug in 2017.1 where the player OnControllerColliderHit would fail CompareTag conditional checks (but only in build executables, the editor seems to have no problem with this.)

    The culprit seems to be an empty tag in the middle of our TagManager.asset (which unity seems to create whenever you delete a tag using the Tags & Layers interface.)

    All tags after the empty tag seem to silently fail (or return false when using CompareTag.)

    If we fill the empty tag with a bogus string, the problem goes away.

    Not sure if other people have this problem, just checking before reporting this as a bug.