Search Unity

Bug Instanced prefab from resources missing child gameobject

Discussion in 'Prefabs' started by codifies, Feb 11, 2021.

  1. codifies

    codifies

    Joined:
    Jun 29, 2013
    Posts:
    22
    I have a prefab in resources, it started out with just a camera and capsule

    This instances fine from Resources

    However I added a particle system to the prefab, this is there and working fine if I drag the prefab into a scene from the resources folder, but not if Instanced by

    var prefab = Resources.Load<GameObject>("playerPrefab");
    var inScene = Instantiate<GameObject>(prefab);

    its simply missing the child GameObject with the particle emitter

    This looks like a bug to me OTOH I could be holding it wrong...
     
  2. codifies

    codifies

    Joined:
    Jun 29, 2013
    Posts:
    22
    forgot to mention running 2020.2.3f1 on Linux
     
  3. codifies

    codifies

    Joined:
    Jun 29, 2013
    Posts:
    22
    tried a copy of the project in the beta with the same behaviour 2021.1.0b6
     
  4. codifies

    codifies

    Joined:
    Jun 29, 2013
    Posts:
    22
    seems dontDestroyOnLoad isn't protecting it....