Search Unity

Components disappear

Discussion in 'Editor & General Support' started by Innovine, Sep 14, 2020.

  1. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    I have a big fbx with many objects in it, and in Unity I I have assigned materials and attached many components to these objects, and tweaked the components variables.

    Sadly, I just noticed that if I export only the selected object in Blender, the fbx naturally only contains one object, unity updates, and all my attached components and their values disappear without warning. If I export again from Blender, this time exporting all the objects, Unity updates, and I see them all again without the components. Oddly enough, the materials I assigned are still present, but the components are lost.

    What can I do to avoid this? I just lost hours of tweaking variables with no warning whatsoever, due to that little "export selected object" tick box
     
    Last edited: Sep 14, 2020
  2. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    Is there any way to mitigate or work around this? Should I create a prefab of my object heirarchy now and then as a type of save?
     
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    I would be cautious about your approach of putting a lot of stuff on the FBX directly. I've run into the same issues as you in the past. What I tend to do these days is to place the FBX within a parent container, attach a script to the parent container, and programmatically add components to the objects within the FBX on Start(). This is much safer. You can swap out the FBX without fear of losing the component, since it's added via scripting instead of in the Editor.