- Home /
Is there a Unity 5 Bug affecting tags with Android builds?
After upgrading to Unity 5 I noticed my code worked in the Unity Debug Player but not when I push it to my android devices. Is this a known bug? If so I could not find it documented anywhere.
I noticed it initially with my collision gameObject.CompareTag("SomeTag") they just were not working when I pushed the builds to device for testing.
I simplified it to the below test and it still works in Unity Remote but not when I push it. debugText is a UI Text
void OnTriggerEnter(Collider c)
{
debugText.text += "\nHit " + c.tag.ToString();
}
After spending most of last night adding debug comments and rebuilding the project I finally broke down and built a new project this afternoon and did some simple collision and tag comparisons testing with cubes and everything seems to work fine.
$$anonymous$$y next guess is something happened with the project upgrade. So I guess I will be exporting assets and rebuilding my project from scratch tonight. Hopefully that fixes it and I wont have to rebuild the objects themselves.
I actually took the assets from my working test and imported them to my 4.6 upgrade package and they started doing the same thing once in that package.
Hi, known issues are listed in our release notes (for future reference): http://unity3d.com/unity/whats-new/unity-5.0
I have done a quick search in our bug reporting system for your issue (you can also do a search on our issue tracker: http://issuetracker.unity3d.com/) but haven't found yet a reported bug for a case similar to yours. Let our devs know by creating a bug report: http://unity3d.com/BugReportingFAQ
I had a problem like this and solved it this way:
Try checking the tag list in editor going to the "Add Tag" menu and check that the tag you are using is there
I had my "Pick Up" prefab with the "Pick Up" tag and the "Pick Up" tag was showed on the inspector for every "instance of the prefab" (I don't know if you say it this way)
But then I checked the "Add Tag" menu and the Tag List was empty, so there was the problem.
I had the same problem on android device. In my case I removed a tag and Unity needed to update the tag list, so once reloaded the project worked fine.
Answer by bkachmar · Apr 30, 2015 at 06:19 PM
Hi,
I just had almost the same issue, but I was building for PC. In my case after Upgrading the project to Unity 5 all the tags from project settings disappeared. Somehow everything worked in editor, but after packaging it crashed. So I just added all the tags to project settings and to game objects and now everything works.
Hope this will help you.
This is it. For some reason when I tried to build my project it deleted all the tags without me knowing. seems like a bug but once you know what is happening it is an easy fix.
Answer by chrisvarnsverryvirtualarts · Jul 25, 2017 at 09:22 AM
In my limited experience, after adding a new tag, that tag won't work for me on Android until I restart the editor on PC.
Thank you! I had even tried creating new tags and switching the code to use the new tags and they would all get ignored. Restarting the editor and rebuilding for Android worked.