Search Unity

My Tags are getting changed, when its loaded from Asset Bundle.

Discussion in 'Editor & General Support' started by tonycsharks, Apr 18, 2017.

  1. tonycsharks

    tonycsharks

    Joined:
    Dec 31, 2015
    Posts:
    27
    I have created an asset bundle from several scenes. After downloading and loading the scenes, the tags for the game objects are either becoming as Undefined or the tags for the game object are getting changed. For example.

    Case 1:

    I have assigned a tag named "Tag1" to a gameObject named "GameObject1" and when the scene is loaded from asset bundle, the GameObject1's tag is showing as Undefined instead of "Tag1". Because of this, my game stops working. Its working fine when I'm not using asset bundle.

    Case 2:

    I have assigned a tag named "Tag1" to a gameObject named "GameObject1" and a tag named "Tag2" to another gameObject named "GameObject2". and when the scene is loaded from asset bundle, the GameObject1's tag is changed as "Tag2" and GameObject2's tag is changed as "Tag1". Because of this, my game stops working. Its working fine when I'm not using asset bundle.

    Why are the tags not properly working when the scenes are loaded from asset bundle? Is there any solution for this issue?
     
  2. devmanDavid

    devmanDavid

    Joined:
    May 25, 2017
    Posts:
    1
    i have the same problem like Case 1, sometimes when the scene is loaded from asset bundle, the object will lose its tag and showed as untagged, this seems to happen when I focus out of the Unity Editor window for a while and then focus back on it.
     
  3. Aeonic

    Aeonic

    Joined:
    Oct 29, 2017
    Posts:
    3
    Same here. Unity 2020.3. Sometimes I get null refs - object has no tags and code fails. I run the scene again, and everything is ok and tags are present.
    Scene is not dynamic, so tags missing are not due to coding error.
    Scene is loaded from asset bundle.