Search Unity

Yaml scene merge broke the scene

Discussion in 'Editor & General Support' started by novaVision, Jan 11, 2021.

  1. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    518
    First time ever I see the case like that:
    I am using git with multiple branches (master/dev/next_version) and switch between them pretty often.
    A week ago we released new app version and I commited it to master and proceeded in dev branch. I am 100% sure that scene worked fine, I tested it hundreds times.

    What happens now - I did some dev and testing and had to create a hot fix for recent release, but starting the scene in editor using the latest commit I get these errors:
    report.png
    and "Missing Prefab (Dummy)" object has created on the top of hierarchy. Stopping the playback, this object not being destroyed.

    The worst here that there is no info at all, even in Editor log. I don't see any option to try find the source of the problem.
    Code (CSharp):
    1. Component (RectTransform) added to multiple GameObjects! Removing it!
    2. (Filename: ./Runtime/BaseClasses/GameObject.cpp Line: 876)
    3.  
    4. Transform component could not be found on game object. Adding one!
    5. (Filename: ./Runtime/BaseClasses/GameObject.cpp Line: 744)
    6.  
    7. GameObject has multiple Transform components! Merged into single one.
    8. (Filename: ./Runtime/BaseClasses/GameObject.cpp Line: 895)
    Furthermore, switching to ANY older then this release commit I got the same issue, but I worked on it for 1 week before, and that was absolutely OK until I switched the branches.

    I found only 1 thread on the forum about it saying that scene could be merged incorrectly by Yaml, but this doesn't describe my case much...
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,735
    Merging YAML (scenes or prefabs) is a huge open festering wound in Unity3D when using multiple branches of source control. We bump into it all the time. Unity offers a YAML merging tool but our team has never been able to make it work better.

    Our solutions are to:

    - clone scenes when going into a release branch, IF massive changes are expected

    - hand merge scenes (and prefabs) only (by duping them in the branch, then bringing both up and working between them by hand AFTER the merge takes place and both versions are visible)

    - break scenes into lots of subscenes, each loaded additively (doesn't help in all cases but can definitely reduce churn)

    The underlying issue is that often the default git merge will work just fine, but the scene will have subtle damage which you will not notice until much later.

    And if your branch is a long-lived pending feature branch, the more time it spends away from develop / master, the worse it gets, the higher chance of silent errors.

    It sucks and I have yet to see any solution that actually addresses it.
     
    EricWilliams likes this.
  3. kjyv

    kjyv

    Joined:
    Feb 20, 2018
    Posts:
    53
    I was usually able to fix this by looking for any prefab references in the scene that were missing or/and deleting the Library folder. Unity might have kept some state from the previous repository state and was not smart enough to update it I guess