N
N
NickName73312018-03-16 23:54:14
C++ / C#
NickName7331, 2018-03-16 23:54:14

Unity (C#) - How to check if an object exists?

There is an object that can be destroyed during the game (Destroy (gameObject)), you need to check if it is destroyed (does it exist) through if? How can I do that? Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Simonov, 2018-03-17
@NickName7331

GameObject go = ...(GameObject.Find например или просто ссылка);
 if (go == null) {
  // Уничтожен
 }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question