FindObjectOfType, does it search only on the component?

When retrieving an object with FindObjectByType, does it look on the current object, in the scene, in the prefabs?

Hi Pilfton,

FindObjectOfType looks for the “first” object of the type in the entire scene, whatever Unity defines as “first”.

GertComponent looks for the “first” object of the type on a game object.

Is this what you wanted to know?

So the FindObjectOfType will not look on the object itself? only in the scene?
Thanks for your time

If the game object is part of the scene, the FindObjectOfType method will also check that game object.

How are you getting on with this, @pilfton? If the problem is solved, please mark a solution to close the thread. :slight_smile:


See also:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms