Search Issue Tracker

By Design

Votes

0

Found in [Package]

1.18.11

Issue ID

ADDR-2074

Regression

No

[Addressables] Static objects cease to be Static on Scene change

Package: Build Pipeline - Addressables

-

Steps to reproduce:
1. Download and open the project "AddressableSceneChangeLosesStatic.zip"
2. Select Window > Asset Management > Addressables > Group
3. In the Addressables Group Window, select "Play Mode Script" and choose "Use Existing build"
4. Click on Build > New Build > Default Build Script
5. Open Assets/_Scenes/Rooms/GameRoom_Hub4.unity
6. Select the GameObject "Cube(3)" in the Hierarchy (Root > GameRoom_Hub4_Geom > Room)
7. Notice that the GameObject is marked as "Static" in the Inspector
8. Open Assets/_Scenes/test.unity
9. Enter Play Mode

Expected result: The Cube(3) GameObject remains Static when GameRoom_Hub4.unity Scene is loaded
Actual result: The Cube(3) GameObject is not Static when GameRoom_Hub4.unity Scene is loaded

Reproducible with: 1.16.19, 1.18.11 (2018.4.36f1, 2019.4.29f1, 2020.3.14f1, 2021.1.14f1, 2021.2.0b3)

  1. Resolution Note:

    gameObject.isStatic is just in the Editor. getting this value at runtime will return false. Is a build time only value. see https://docs.unity3d.com/Manual/StaticObjects.html

    static does not mean that it cannot be moved. But that the contents of the gameObject will be included for static batching. see https://docs.unity3d.com/Manual/StaticObjects.html
    If you only have one object that is being batched like the sample scene with a single cube, then it is already optimal and there is no more to combine with.
    If you were to have a second mesh that is static in the scene. The meshes are combined at build time and the meshRenderer will reference that instead, as a result of which then when you move the gameObject it wouldn't move the mesh because it was static batched and combined with others.

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.