Search Issue Tracker

Fixed

Fixed in 2022.3.61f1, 6000.0.43f1, 6000.1.0b11, 6000.2.0a7

Votes

0

Found in

2022.3.56f1

6000.0.35f1

6000.1.0b3

6000.2.0a1

Issue ID

UUM-95786

Regression

No

The original Scene is built with the additive Scene's contents when loading the additive Scene on Awake

-

Reproduction steps:
1. Open the attached project "ReproProj"
2. Build and Run the “Scenes/Menu“, “Scenes/MainScene“ and “Scenes/AdditiveScene” Scenes
3. In Player press the “Spacebar“ key

Expected result: The Scene remains the same
Actual result: Scene changes

Reproducible with: 2022.3.56f1, 6000.0.35f1, 6000.1.0b3, 6000.2.0a1

Reproducible on:
Windows Standalone Player

Not reproducible on:
Play Mode

Testing environment: Windows 10 Enterprise 21H2
Not reproducible on: No other environment tested

Note:
- Sizes of “level1“ and “level2“ files in “<your-build-folder>/BuildTests_Data/“ folder are the same despite having different assets
- Reproducible with Mono and IL2CPP
- Reproducible with Addressabes and normal build pipeline
- Reproducible with Clean Build

Comments (1)

  1. Mads-Nyholm

    Mar 04, 2025 19:29

    You have two workarounds until the fix lands:
    1) Instead of using Awake() then use Start()
    or
    2) You already check for isPlaying, also check for isBuildingPlayer as in the following example:

    (Apologies for the bad formatting)

    [ExecuteAlways]
    public class EditorAdditiveSceneLoader : MonoBehaviour
    {
    #if UNITY_EDITOR
    public string scenePath;

    void Awake()
    {
    if (Application.isPlaying || BuildPipeline.isBuildingPlayer)
    return;

    if (string.IsNullOrEmpty(scenePath))
    return;

    EditorSceneManager.OpenScene(scenePath, OpenSceneMode.Additive);
    }
    #endif
    }

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.