Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by Max_Bol · Mar 28, 2016 at 03:00 AM · editorclonebug reportcachefindgameobjectswithtag

Engine breaking bug : Unity scene's instantiation is completely broken. (Temporary fix found, but not permanent)

Okay, First, thanks for reading this.

I would like to mention that I got absolutely no idea about "why" this is happening, but it is and I have been looking around for possible solution or even just an idea of what is happening for a whole day.

The thing is, it seems like, since this morning, Unity can't seem to manage its scene asset correctly anymore. When one error is "fixed" (or evaded), another pop-up and, by the end, all point toward how Unity initiate a scene.

There's the problem : Unity seems to destroy and rebuild assets in the scene for no reason at all. - At first, it started with something as simple as "PlayerCharacter = GameObject.FindGameObjectWithTag("Player");" not finding the prefab of the player (which is the only asset in scene with a "Player" tag). - Then it started to find a hidden (Clone) of it which, when looked at (double click on it through a reference in the inspector), it seems to be a clone of the original model (not the prefab). Note that the asset in the scene is the prefab with multiple scripts attached to it.

Up to this point, restarting Unity seemed to fix to problem for a single try. After launching the preview a second time, the error came back.

  • After a while, it seems like it find a "Missing (GameObject)".

  • Now it's not even finding anything at all. (None)

At first, I though it was an issue with how the camera (which has the script that looks for the player) was launching its "Awake()" before the player's (which includes some stats), but then I remembered that the camera doesn't even have its script attached on launch and that it's actually the players' script that add the camera managing script onto the main camera of the scene once it completed in getting its data. So, that means the Camera only gets its Awake() method read once the Players' Awake() method has passed since the script is only added by then.

So, I build a Scene manager script that instantiate things in a specific order. It didn't do anything differently and the errors still are showing around. (Mostly, missing references errors around the player not being found.)

I read around about how the "Player" tag seems to be buggy at times and using a new one (like "player") fix it. It did fix some part of another issue that appeared, but still, it seemed like I couldn't get a component in the player's prefab as it always returned None, Missing or (Clone) without changing anything... just by restarting Unity and relaunching the scene.

Then, for the sake of testing it out, I made it so that whenever "PlayerCharacter = GameObject.FindGameObjectWithTag("player");" return anything that includes "(Clone)", to destroy that clone and do a search again. This made Unity hang and crash with the same behavior as if it was charging the script an infinite amount of time. It also means that Unity wasn't able to find an existing asset in the scene by tag.

I finally found a turn-around-solution by forcing the actual Prefab's script which add the camera manager script onto the camera to also include the reference to the prefab's GameObject itself when the function is called. This worked and all is currently working as it was working for a month up to this morning.

The "only" hint I got about what could have triggered this is that as I added some new animations to the player character (not directly within the prefab related file), I noticed some bad mesh skin topology (while testing an animation) and fixed some of the skinning. I rebuild the whole prefab manually from the new model file I exported, added the same scripts, then as I tried it, the errors started. (All animations are saved in a set of separate files and only include the bones/armature structures. The original mesh file of the prefab only includes the character in a T-Pose.)

I was wondering if it's related to some corruption in the temporary files stored by Unity which then seems to stuck itself with some old version of a file (the (Clone), then missing references as an hint). Is there a way to clean all Unity's cache as this problem might have been related to the change I have made to the player mesh?

Have anyone ever seen this problem?

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

0 Replies

· Add your reply
  • Sort: 

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

57 People are following this question.

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

Related Questions

Unity PERSISTENT error: Assertion failed on expression: 'VCCache::instance != NULL' unity 0 Answers

Unity Editor Text Goes Crazy 0 Answers

(Android) Unity crashes on building process 0 Answers

Unity 5.2 Freezing when Resizing Game View after Play 0 Answers

Unity Cache Server on Personal License? 0 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