Quantcast
Channel: Questions in topic: "tagging"
Viewing all articles
Browse latest Browse all 120

FindGameObjectsWithTag returns results only within hierarchy of calling gameObject

$
0
0
I have the following simple validation to check if an UI pane is present in the scene: public static bool IsMenuDialogActive() { return GameObject.FindGameObjectsWithTag("MenuDialog").Length > 0; } And i have two UI GameObjects that call that method, 'A' and 'B', and B is a child of A. 'A' is an object that can have one or more 'MenuDialog' child objects active at a time. ---------- If I call IsMenuDialogActive() from within 'A' it returns true if any of these child objects is active. But if call it from within 'B' it returns zero objects. I suspect that FindGameObjectsWithTag only searches for tagged objects within the hierarchy of the object that calls it. But this is not clear from the documentation for FindGameObjectsWithTag. Is this a correct assumption?

Viewing all articles
Browse latest Browse all 120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>