Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Scene Template is Listing a Scene as a Dependency For Some Reason

Discussion in 'Editor & General Support' started by samboknight, Mar 16, 2023.

  1. samboknight

    samboknight

    Joined:
    Aug 31, 2019
    Posts:
    20
    I have a scene template that has, for some reason, decided that it has another completely unrelated scene as a dependency. I double and triple-checked the scene used for the template, and it contains zero references to any other scene, so I'm a bit perplexed as to how Unity has determined that there's a dependency.

    For any other asset, this wouldn't be a big deal, as I could just uncheck its Clone box on the dependency list. However, if a scene is on the dependency list, its checkbox is locked in the checked position. This means that every time I create a scene using the scene template, a copy of the dependency scene will be created, and there's no way to change this behavior.

    How can I force Unity to remove the scene from the dependency list?
     
    AtlinxNet likes this.
  2. sebastienp_unity

    sebastienp_unity

    Unity Technologies

    Joined:
    Feb 16, 2018
    Posts:
    201
    Hi @samboknight ,

    Can you provide more information on your bug?

    - Which unity version are you using?
    - Can you share the project you are working on? If so I would suggets you log a bug using Help-> Bug reporter and attach your project to the bug report. I would try to repro and to fix.

    A few information about Scene Templates:
    - We are computing the dependencies of the scene using AssetDatabse.GetDependencies. Maybe right click on your scene and select "Select Dependencies" and check if the "faulty" scene is selected or not.
    - I have notice in code that we prevent user from modoifying the clone flag on scene (we do this for some assets that are problematic). That said, I am unsure why it is like this for scene. IMHO it should be modifiable. I will adress this in the next round of bug fixing and backport it to 22.2 and 21.3 That said if you log a bug about this you would be notified when the fix will land.


     
  3. AtlinxNet

    AtlinxNet

    Joined:
    Feb 25, 2017
    Posts:
    7
    I'm also experiencing this issue in 2021.3.14f1. I'm using the Scene Reference plugin from Eflatun to refer to scenes with SceneAssets in the inspector, however, I don't understand why the SceneAsset must be cloned when creating Scene Templates.
     
  4. samboknight

    samboknight

    Joined:
    Aug 31, 2019
    Posts:
    20
    It turns out that the scene template in question had a somewhat roundabout reference to the "unrelated" scene. I was able to sniff out the reference using this package: https://github.com/yasirkula/UnityAssetUsageDetector
    I was then able to set things up a bit differently so the reference wasn't needed.