Search Issue Tracker

By Design

Votes

8

Found in

5.3.0f4

Issue ID

753656

Regression

No

[LoadSceneAsync] allowSceneActivation flag is ignored in Awake()

Scene Management

-

Repro steps:
1) Open the project and scene Awake in it
2) Play and notice that exception appeared (ERROR ERROR ERROR)
3) Stop and load scene Update
4) Play - notice there is no exception
5) Stop - notice the exception appears

Workaround: Use Start() or Update() to load the scene

Repro in: 5.4.0b1; 5.3.1p1; 5.2.3p3; 5.1.4f1

Comments (21)

  1. rex1313

    Apr 16, 2022 06:44

    This is so funny. Yet again I faced an issue with so basic functionality believing I don't understand something because yet again I couldn't believe such basic stuff can be broken. Then yet again I found this page, where the issue really exists, and yet again has the status "Won't fix". Of course, in order to make it work somehow, we need to apply so dirty workaround (delay in this case).
    Honestly, I chose Unity for my first game because I thought it will be easier to do it here (C# vs C++ in competition), but man... How many hours and days do I spend resolving issues like this? How much money I spend in Asset Store because built-in solution just don't work good enough. Then how much hours I spent on writing custom tools for making basic stuff that it is just built in in competitor.
    I can't wait till finishing my first game - its too far in development to move it somewhere else - so I don't have to see this engine anymore.

  2. Ramlock

    Jun 15, 2021 18:26

    I have to agree with my fellow devs that came before me. There is no possible way this is "By Design".

    Are you saying when they had the meeting about adding the allowSceneActivation functionality the Lead Engineer said "but let's make it not work if it's invoked in Awake() or similar methods, that will confuse the hell out of the devs muahaha"

    For real, why would it possibly be a design choice to make this feature not work? And don't even bother saying "It's because the scene is then loaded immediately" because, once again, if we wanted the scene to be loaded immediately, we wouldn't be calling "LoadSceneASYNC" with "allowSceneActivation=FALSE".

    The real resolution of this issue report is "Won't Fix". Don't lie to us Unity, you just don't care enough.

    The official documentation states:

    "You should set and use AsyncOperation.allowSceneActivation in coroutine functions. You cannot set and use AsyncOperation.allowSceneActivation within Awake, because this function is not a coroutine."

    How is it you've made a property that only works if it's called from within a coroutine? Why would you use such witchcraft?

  3. Madgineer

    Dec 24, 2020 23:19

    It appears that at the start of your coroutine you must add a
    yield return new WaitForSeconds(.2f);

    This is shown in the documentation.
    However in the documentation its:
    yield return null;

    This no longer works.
    They need to update the documentation because it also uses:
    "LoadLevelAsync"

    Which appears to be now obsolete.
    Dont quote me on that, real shallow dive on that one.

  4. sbsmith

    Aug 04, 2020 20:08

    In 2018, you could get around this by starting a coroutine and waiting one tick. This workaround no longer works for 2019.

  5. Tibor-Udvari

    Jun 28, 2020 20:08

    It seems to work for me with an IEnumerator Start

    IEnumerator Start()
    {
    yield return new WaitForSeconds(0.2f);
    //...

  6. Hex0dus

    Jun 17, 2020 19:13

    In unity 2019.4 it's not working AT ALL! Not in Update, Start or in Coroutine. Not fixing a clear bug since 2017 is shameless!

  7. unity_SRZXyHN7P3fFcA

    Jun 10, 2020 20:59

    On 2019.3, June 2020, still not working. Tried Start() and Update(). Neither work!

  8. vzlomvl

    May 07, 2020 11:40

    Do you have any updates?

  9. Lowscope

    Feb 17, 2020 00:30

    Thanks, wasted quite a bit of time on this design choice.

  10. tobias_unity36

    Dec 20, 2019 09:09

    How is this "By Design"?

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.