Search Unity

Unity 5.3 - Objects in scenes loaded from AssetBundles are losing their STATIC flag

Discussion in 'Scripting' started by dreasgrech, Jan 5, 2016.

  1. dreasgrech

    dreasgrech

    Joined:
    Feb 9, 2013
    Posts:
    205
    I am currently on Unity 5.3.1p1 and encountered an issue when loading scenes from AssetBundles.

    I have noticed that when loading a Scene from an AssetBundle, all of the objects in that AssetBundle Scene lose their STATIC flag.

    The way I am loading the Assetbundle is with SceneManager.LoadSceneAsync but the issue also happens when using the non-async method. The issue also occurred when using both LoadSceneMode.Additive and LoadSceneMode.Single as well.

    The AssetBundles are uncompressed and target the Windows Standalone platform.

    Has anyone encountered this issue? I was able to reproduce this on an empty project.
     
    Last edited: Jan 5, 2016
  2. dreasgrech

    dreasgrech

    Joined:
    Feb 9, 2013
    Posts:
    205
    Anyone able to reproduce this issue?

    It doesn't seem to fixed in Unity 5.3.1p2 either.
     
  3. dreasgrech

    dreasgrech

    Joined:
    Feb 9, 2013
    Posts:
    205
    I have just tried again on Unity 5.3.1p3 and it's still not fixed.

    When my scene loads from the Asset Bundle, all the objects from the Asset Bundle load without their STATIC field checked!

    Is there anybody out there...?
     
  4. dreasgrech

    dreasgrech

    Joined:
    Feb 9, 2013
    Posts:
    205
    Can anyone else reproduce this bug?
     
  5. halfshey

    halfshey

    Joined:
    Apr 26, 2015
    Posts:
    15
    I just found this bug too. It is the first time that I'm working with AssetBundles so I thought i did something wrong, but it seems that it just doesn't work.

    When you use the assetbundleManager from Unity (http://unity3d.com/learn/tutorials/...undles-and-assetbundle-manager?playlist=17117) and activate simulation mode everything seems to be fine, but it doesn't work when you are really loading the bundles...
     
  6. dreasgrech

    dreasgrech

    Joined:
    Feb 9, 2013
    Posts:
    205
    Yes, I have also noticed that if I load my levels from the Scene files instead of loading them from the AssetBundles, the STATIC flags remain correct when loaded.

    So this issue only happens when loading scenes from AssetBundles.
     
  7. qiankanglai

    qiankanglai

    Joined:
    Jun 8, 2013
    Posts:
    22
    Confirmed 5.2.4f1
     
  8. MR_asilva

    MR_asilva

    Joined:
    Oct 23, 2015
    Posts:
    13
    Confirmed 5.3.4f1

    Update: the reason we noticed this in the first place is because we were getting incorrect lighting and other lighting-based artifacts. Thought maybe it was because of the static being unchecked in bundles, but it wasn't - turns out it was that we were loading the scenes from bundles as additive, instead of single - once we made them single, the artifacts were fixed. So, not sure if you were seeing any issues from this bug other than potentially performance problems if static batching isn't working properly, but that is how we solved our particular issue - performance hasn't been too bad of a problem for us...yet. ;)
     
    Last edited: Mar 24, 2016
  9. plailabs-dev

    plailabs-dev

    Joined:
    Dec 10, 2012
    Posts:
    12
    I would like to bump and confirm this issue. We have a game that loads all the levels as asset bundles and are put into an empty scene (additive) When the level is loaded we get these errors:
    • Failed opening GI file
    • Failed loading probe set data for hash
    • Error adding system: Data not available
    The light map and light probes seem to be working fine even though it tells me they couldn't be loaded.
    Furthermore all of our static prefabs have the "static" flag turned off, which we think might be creating some performance issues because the static batching is not being taken advantage of.
     
    Last edited: Apr 7, 2016
  10. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,334
    Guys, if you want a bug to be fixed, you need to create a bug report, not post on the forums.
     
  11. diego-borghetti

    diego-borghetti

    Joined:
    Dec 12, 2014
    Posts:
    5
    Did anyone report a bug ? I'm still having this problem with unity 5.5.1f1. Not only from a bundle, also having problems with built-in scenes.
     
  12. w418142153

    w418142153

    Joined:
    Sep 28, 2017
    Posts:
    1
    5.5.3 lost the static flag buy i can see the mesh combine and the frame Bug see the staitc batch maybe inspector bug ~~someone said can use StaticBatchingUtility
     
  13. _USB_

    _USB_

    Joined:
    Jan 3, 2017
    Posts:
    2
    Manually set isStatic = true, and then use StaticBatchingUtility.Combine trigger combine after at least one frame.
     
  14. _USB_

    _USB_

    Joined:
    Jan 3, 2017
    Posts:
    2
    Summary error.It should after at least one frame when instantiate the gameobject,not set the property.