MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access it.
this problem puzzled me for weeks!the whole information is “MissingReferenceException: The object of type 'Transform' 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. UnityEngine.Transform.get_position () (at C:ildslave/unityild/artifacts/generated/common/runtime/UnityEngineTransformBindings.gen.cs:20) Carmra.LateUpdate () (at Assets/Scripts/Carmra.cs:8) ”.alt text please help me !thanks !
The error is in your "Carmra.cs" file. You didn't link the code from that file.
Answer by Dinosaurs · Nov 19, 2015 at 04:39 PM
Based on your code, what's most likely happening is you have stored a reference to a transform in an array, and are trying to access it after destroying it. When you destroy a gameobject, make sure to remove it from any arrays or lists you have added it to and clear any variables referencing it.
Your answer
![](https://koobas.hobune.stream/wayback/20220612045635im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Can't activate unity: License Error 0 Answers
Project won't open with out of memory error 3 Answers
reflection type of load exception in unity.the class in the module can not be loaded 0 Answers
Unity C# Casual Jewel Mining Game - Jewel Unaffected by Claw 1 Answer
How do I reference an incremented int with one button, that was incremented from another button? 1 Answer