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 !

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.