A
A
Alexander2021-07-21 21:54:42
Unity
Alexander, 2021-07-21 21:54:42

FindObjectOfType(); how to find disabled object?

Hello, I really need it. Search in the Update method, when the object is on finds, off. - does not find.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2021-07-21
@AlexandrG44

Declaration
public static Object FindObjectOfType(Type type, bool includeInactive);
https://docs.unity3d.com/ScriptReference/Object.Fi...
Use this overload here.
But in any case, for FindObjectOfType in Update, your hands will be torn off in any decent society.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question