Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Feedback Make it possible to remove the warning "Cross scene references are not supported" when saving scenes

Discussion in 'Editor & General Support' started by Xarbrough, Jun 13, 2019.

  1. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,184
    Unity, by default, prevents cross-scene references in the inspector and logs warnings whenever such cross-references do occur (e.g. when moving a GameObject with references to another scene). This is ok by default.

    However, it is possible to explicitly allow cross-scene references by calling
    EditorSceneManager.preventCrossSceneReferences = false;
    . This makes it possible to drag cross-references into inspector fields without warnings, but whenever a scene with cross-references is saved, warnings are still logged.

    I would like to propose removing these warnings if the preventCrossSceneReferences is false or making it another option to disable this warning.

    Our team is facing a few issues with the multi-scene workflow in Unity and we heavily rely on setting up our own references which are restored in play mode, which generally works fine, but the warnings make it feel broken when it isn't.
     
    Andresmonte, ga5p0d3 and Immu like this.
  2. JohnstableUnity

    JohnstableUnity

    Unity Technologies

    Joined:
    Nov 14, 2017
    Posts:
    4
    What I do is to set the fields to null during the scene saving (register to
    EditorSceneManager.sceneSaving), and then restore the values once saving is complete (register to
    EditorSceneManager.sceneSaved).
     
    DgoodingIndi and Xarbrough like this.