Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by Dst79 · Jun 18, 2015 at 06:43 AM · buildwebplayer

Game works in editor; not builds; "GameObject has undefined tag"

I have been working on a chess game on Unity 5. It works correctly when testing, but after I build to web or exe, and run the game, every time I click a piece, the console spits out "UnityException: GameObject has undefined tag!"

But I checked, all the pieces are tagged, and this is not an error that ever occurs when playing in development mode?

Anyone have any ideas on how to narrow down what's causing this/how to fix? I'm very new to unity (this is only my second project) and would love to get this working.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

5 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Able101 · Jul 06, 2015 at 04:14 PM

I had the same problem and the solution by "Shinugami" solved it: http://answers.unity3d.com/questions/39557/unityexception-gameobject-has-undefined-tag-xcode.html

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image VioKyma · Sep 06, 2016 at 09:19 AM 1
Share

For those looking at this question after the fact, the linked solution basically says to check the tags in Project Settings to make sure they are actually there. Upgrading from Unity 4 or Unity 5 beta can result in loss of the tags in settings.

avatar image
1

Answer by Moath-Qwaqneh · Mar 07, 2017 at 11:04 AM

I faced the same issue but on the Android , I fixed the issue by export the whole of the project and import it to other new project

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image willcthomson · Feb 12, 2018 at 01:27 AM 0
Share

I had a similar issue on my android build. FindWithTag was working perfectly well when running in the editor but returning null when running on Android Build and Run. The project runs fine on Android after exporting the whole project, and importing it into a new project. I would love any insight from anyone why this fixed the issue, and Thanks to @$$anonymous$$oath-Qwaqn

avatar image
1

Answer by Radical · Sep 02, 2017 at 09:01 AM

I was seeing the same error message when running on Android, but not within the editor. The same logic error was occurring on iOS, but I haven't checked the logs to see if this was the exact error message.

This particular project was upgraded from Unity 4 to Unity 5.6.1f1. What I found is that in Project Settings | Tags and Layers there were a few tags marked as "Removed", and a message from Unity stating that they would actually be removed the next time the project was loaded. Unfortunately, reloading the project would never remove them.

My hunch was that Unity was in a state where it thought the tags were up to date, and that there was nothing to do to them at project load.

The answer was to add a temp Layer, save the project, then reload the project. I restarted Unity just to be safe. The "Removed" tags were then actually removed, and everything is now working properly on Android builds. I'll test iOS as well, but I would bet money it's fixed as well.

My assumption is that making a change (adding a layer) marked a dirty flag internally and Unity's cleanup logic at project load now saw that there was a change to the Tags and Layers and did it's normal processing. The tags probably got screwed up when upgrading the project from Unity 4 to Unity 5. That I don't know. The tags look fine in Unity 4.

Afterwards, I did of course remove the temp layer.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by OtisMiller · Mar 18, 2018 at 04:09 PM

I had a similar problem. It seemed to just be one function in the game that wasn't working.

Turned out I had a bunch of empty scripts in my game on a prefab which was giving console errors. Was something I'd neglected to solve earlier. Don't know how, but that solved it. Hope that helps.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Warped · Sep 26, 2019 at 05:23 PM

Right mouse button in project -> Reimport all

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Is there any way to publish my first build ever today? Or the story of a buggy inter webs. 4 Answers

Build working only on some PC 1 Answer

Unity 3.5.3: Where do Web Player games build? 1 Answer

System.Net question 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges