I'm not sure if this is a bug, or if this is something I'm doing wrong, so I thought I'd ask.
I'm using "Destroy Component: Mesh Renderer" on a game object, so that it appears invisible, but isn't destroyed from the scene. I want to add the Mesh Renderer in using "Add Component: Mesh Renderer" at a later time. However, the compiler appears to be throwing this error after removing the mesh renderer:
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.
UnityEngine.GameObject.GetComponents (System.Type type) (at C:/BuildAgent/work/d9c061b1c154f5ae/Runtime/ExportGenerated/Editor/UnityEngineGameObject.cs:63)
iTween.Stop (UnityEngine.GameObject target, System.String type) (at Assets/iTween/iTween.cs:6427)
HutongGames.PlayMaker.Actions.iTweenFsmAction.OnExitiTween (HutongGames.PlayMaker.FsmOwnerDefault anOwner) (at Assets/PlayMaker/Actions/iTween/iTweenFsmAction.cs:64)
HutongGames.PlayMaker.Actions.iTweenMoveTo.OnExit () (at Assets/PlayMaker/Actions/iTween/iTweenMoveTo.cs:110)
HutongGames.PlayMaker.FsmState.OnExit ()
HutongGames.PlayMaker.Fsm.ExitState (HutongGames.PlayMaker.FsmState state)
HutongGames.PlayMaker.Fsm.Stop ()
HutongGames.PlayMaker.Fsm.OnDisable ()
PlayMakerFSM.OnDisable ()
I've double-checked and am not destroying anything else. Further, the later addition of the mesh renderer using "Add Component: Mesh Renderer" does not appear to work.
Can anyone tell me what's going on, and if I'm doing something wrong? I've checked the reference, already, and it wasn't any help. Thanks!