3
\$\begingroup\$

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.

\$\endgroup\$
1
  • 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

0
\$\begingroup\$

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

\$\endgroup\$

You must log in to answer this question.

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