• 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 Destroypattern · Oct 03, 2013 at 12:40 AM · animationgameobjectexception

GameObject has been destroyed, but you are still trying to access it.

Ok, so I know this question has been asked a gazillion times. I see many answers for it, stating that the object needs to be checked for null. Which I do.

Here's the thing. This only happens when I have the Animation window open, and my 'main camera' selected.

Small detail: Everything in my 'game window' is a child of the main camera. (space shooter, big landscape, game happens in the context of the camera window) So anything that spawns comes up in the Animation panel as an object that can be animated. It's really difficult to work with the animation window when errors are popping up all over the place.

Here is the error. I hope I'm not missing something silly here. Again, all 'destroy' calls check for null in my scripts.

Thanks in advance for any help received.

....

MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. UnityEditor.FoldoutObjectState.RefreshAnimatedState (UnityEditor.AnimationHierarchyData data) UnityEditor.FoldoutObjectState.Show (UnityEditor.AnimationHierarchyData data, Int32 level) UnityEditor.FoldoutObjectState.Show (UnityEditor.AnimationHierarchyData data, Int32 level) UnityEditor.FoldoutTree.Refresh (UnityEditor.AnimationHierarchyData data) UnityEditor.AnimationSelection.Refresh () UnityEditor.AnimationWindow.RefreshAnimationSelections () UnityEditor.AnimationWindow.OnGUI () System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

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 TrickyHandz · Oct 03, 2013 at 01:25 AM 0
Share

The error is being thrown by Unity's editor code...not yours. I would suggest putting in a bug report with Unity about it. Just go to "Help/Report a Bug" and attach your project to the bug report so they can check it out.

avatar image Destroypattern · Oct 03, 2013 at 02:18 AM 0
Share

Case opened. Pasting link here for my own reference https://fogbugz.unity3d.com/default.asp?567262_hhmdukgqqffk0a94

I may try a workaround, like detaching everything underneath the camera, and update positions to match the camera via script. #shrug

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

15 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

Related Questions

why not run animation when doublication gameObject ???? 0 Answers

C# Make Child Not Animate Looped Animation 1 Answer

GameObject reacts to audio source 1 Answer

adding animation dynamically by script 0 Answers

Script to override motion while animation plays 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