Search Issue Tracker
By Design
Votes
8
Found in
5.3.0f4
Issue ID
753656
Regression
No
[LoadSceneAsync] allowSceneActivation flag is ignored in Awake()
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
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
AlrexX1
Jan 22, 2023 12:52
If it helps anyone, I've found that waiting a frame (yield return null;) before setting allowSceneActivation within a coroutine should work fine. Still baffling that they marked this as "by design"...
Denis-535
Dec 08, 2022 11:25
How it could be by design?
Do you understand that you are mocking us?
_FLX
Oct 29, 2022 07:08
Bad joke.
How can you break something so basic and essential ?
It looks like you're actively trying to get indies away from unity, again and again and again
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.
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?
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.
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.
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);
//...
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!
unity_SRZXyHN7P3fFcA
Jun 10, 2020 20:59
On 2019.3, June 2020, still not working. Tried Start() and Update(). Neither work!