I am trying to animate a gameObject using LeanTween which has got destroyed already.

The MissingReferenceException occurs in LeanTween.setOnUpdate();

The null check doesn't work either: (gameObject != null)

I have used LeanTween.cancel(gameObject,false); but it still throws an exception.

  • 1
    \$\begingroup\$ You can check if a gameobject is active or not in the hierarchy with, (gameObjectName.activeInHierarchy == true) \$\endgroup\$
    – Thalthanas
    Jul 28, 2017 at 6:03

1 Answer 1


Null check does not work for gameobjects so using is null or is object is a better idea. Never check monobehaviors with != null


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .