Search Unity

Built-in tree creator doesn't work with prefab variants

Discussion in 'Prefabs' started by Flavelius, Apr 19, 2019.

  1. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    596
    As the title says; It modifies/replaces the base prefab instead of saving the/as variant.
    Or did i maybe miss an important step to make it work with the variant feature?
    - I saved the tree object as prefab, rightclicked -> create prefab variant and edited the variant.
     
  2. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    436
    Sounds like a bug, please file a bug report
     
  3. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    596
    Done. (Case 1148366)
     
    SteenLund likes this.
  4. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    596
    Interestingly, i now received the answer that this is by design.. In this case it appears to be not a good design as it works against expectation and has hidden negative side effects. Atleast it was also mentioned that the issue will be kept open until an idea on how to resolve the UX part of this issue is found. I'm not sure though why the generated data can't be stored with the variant. Fixing this would benefit a lot more use cases imo.
     
  5. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    436
    Hi @Flavelius

    The problem comes from the fact that the TreeData is an added asset object in the base prefab.
    Variants only instantiate the GameObject hierarchy from the base Prefab not any added asset objects, those are simply referenced.

    So when working on a variant of the Tree prefab you are in many cases touching the TreeData of the base prefab, which is by design and therefore this issue is not classified as a bug.

    That said. The Tree editor needs to be revisited and updated to handle variants, but this is low priority.
     
    Roni92pl likes this.
  6. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    596
    Thanks for clarifying; i understand that this is why it's the way it is. What i was trying to say, in a not very clear way, as far as i understand variants are baked out to full assets anyway on build; so this generated data should be stored in the variant asset instead of the base (AddObjectToAsset in user-space). I can think of Probuilder having to deal with similar potential issues.
     
  7. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    436
    Hi,
    GameObjects are baked out in the variant not the TreeData, this is baked into the base and referenced from the Variant.

    And yes ProBuilder will also have to handle variants.
     
  8. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    261
    Yup, tree editor definitely could use an update! :D