Scene.GetRootGameObjects throw exception even when object is loaded and scene knows how many root objects it has already.
So we still use ald stuff like FindObjectsOfType( ).Where( go => go.transform.parent == null ) to retrieve scene roots mostly in all codebase because we need this exactly in Awake and can not wait any longer.
Why and for what we have exception there?
Would it be fixed?
If you believe you found an issue in Unity, I recommend to submit a bug-report following the advice in this document.
Using the bug-reporter seems to be an important step, because it makes sure the report is in Unity Technologies bug-tracking pipeline and has to be processed at some point. Using the forum is often used to add to a little more attention to a bug-report, but does not replace submitting a bug-report.
It’s from advantage to attach a project to the bug-report that UT can use to reproduce the issue and test their fix against. The easier an issue can be reproduced by QA, the more likely it is to get forwarded to a developer, who might or might not work on a bug-fix for that at some point.
After you submitted the bug-report, you receive a confirmation email with a Case number. UT often asks us to post the Case number in the forum thread, which allows them to find that bug-report if they look at your post.
Following these steps will increase the chance that UT is looking at your issue tremendously.
I know all of it, but I ask for help because may be it by design and no need to create bug report. And if it is every one on forum will know, not only me.
I have tested locally SceneManager.GetActiveScene().GetRootGameObjects() and it works fine for me with Unity 2017.1, called in Awake function of my GameManager.cs Do you have the full stack trace of your error and the script used ?
–
Game Rules
Unified Visual Scripting Asset with rules engine