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
0
Question by poday · Feb 05, 2013 at 11:25 PM · erroreditordebug

Tracking down causes of Editor errors.

Is there a way to track down the errors that the editor gives that don't have callstacks?

Specifically I'm getting the errors:

C

ompareBaseObjects can only be called from the main thread.

Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
C

an't destroy Transform component. If you want to destroy the game object please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.

The only other information that these errors provide is the Unity internal source file that caused the errors:
c:/BuildAgent/work/812c4f5049264fad/Runtime/ExportGenerated/Editor/UnityEngineObject.cpp at line: 19
c:/BuildAgent/work/812c4f5049264fad/Runtime/Misc/GameObjectUtility.cpp at line: 1011

I've searched my code and haven't been able to follow the advice in the errors. Is there any additional information that can be gleaned? The editor log doesn't provide any more information. I know that my scripts are the source of the problem but I need to narrow down the problem before I can fix it.

Comment
Add comment · Show 2
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 GuyTidhar · Feb 06, 2013 at 01:16 PM 0
Share

Are you using a dll or are you using a thread or any class that might use threads (e.g. C# timer)?

If so, make sure, you do not call anything related to Unity API from within that thread.

avatar image poday · Feb 06, 2013 at 01:48 PM 0
Share

I am using some 3rd party dlls so I can't speak to what they're doing internally. But I first question my own code when looking for bugs.

As for my own threading, I make sure that I'm not using any Unity APIs from separate threads.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by ivarboms · Feb 07, 2013 at 09:59 AM

You can use MonoDevelop to help tracking down errors like this, at least if they're caused by exceptions being thrown. Unfortunately Unity will often only log a debug message when an error occurs rather than throwing an exception.

To debug exceptions, do the following: In MonoDevelop, open Run->Exceptions, and move all the exceptions except for UnityEngine.ExitGUIException to the "Stop in exceptions" window. Now attach MonoDevelop to the Unity editor and enter play mode. MonoDevelop will now break whenever any of the exceptions are thrown, even from threads other than the main thread.

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 poday · Feb 07, 2013 at 07:35 PM 0
Share

This was a pretty good idea but it didn't seem to catch the errors. I'd still catch the ExitGUIExceptions when entering/exiting playmode (I'm assu$$anonymous$$g because ExitGUIExeption inherits from System.Exception). And I'd catch a few stream related exceptions when opening logs.

The errors were not as frequent (or toggling between the debugger and unity changed the repro) but when I did eventually get the "Can't destroy Transform component" error message $$anonymous$$onodevelop hadn't caught that exception.

Also running playmode twice would cause the editor to become unresponsive and I'd have to kill it from task manager & relaunch it.

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

11 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

Related Questions

Prevent editor-prev.log file from getting too big 1 Answer

Vehicle Script Help 1 Answer

How to resolve UnauthorizedAccessException 0 Answers

Editor Console window message no longer wraps... Help? Please? 1 Answer

Unity Script Editor Not Working 1 Answer


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