G
G
Gregory2562021-11-21 19:26:55
Unity
Gregory256, 2021-11-21 19:26:55

Why not use FindObject?

Kind time of the day, please tell me if using FindObject greatly harms the project? The situation is that in my project one object is active when another is active. Now, because of the fear of using find, I bring everything through the inspector. There are few conveniences in this, but I read that using find greatly overloads the project.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anatoly Ravesky, 2021-11-21
@Gregory256

If you use in Update - strongly. If you use in Start (i.e. caching) - acceptable.
The more objects on the scene, the longer the method runs.
There is a better way. Read about the Service-Locator pattern. Enough for the first time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question