Search Unity

Strange bug with renaming the scene

Discussion in 'Editor & General Support' started by RacingS0UL, Mar 4, 2020.

  1. RacingS0UL

    RacingS0UL

    Joined:
    Feb 8, 2020
    Posts:
    2
    Unity 2019.3.3f1

    Would like to share a very strange bug I experienced after I renamed a scene.

    Here is how I got it:
    1) I had another scene opened in hierarchy;
    2) in project window, I renamed the scene in question;
    3) I switched to the scene I just renamed - hierarchy showed empty scene (it wasn't folded/collapsed view or anything like that). It was completely empty - no camera, canvas, objects, nothing at all. At first, I thought that it was just a new empty scene I accidentally created... negative - the original scene's gone (

    4) closing/reopening editor didn't fix anything.

    Was fortunate enough to have a backup of the project I was working on; still, had to spend time re-implementing some new features.

    After I finished restoring the project, I closed the editor and also decided to restart Unity Hub (V2.2.2). However, i couldn't restart it - it gave me error "Unity hub entry point not found..." Checking Apps & Features revealed that Hub was just updated to V2.3.0. Had to reinstall it myself to make it work.

    Super strange...

    Make sure to backup your projects!


    P.S.: I tried replicating the bug, but it was unsuccessful.
     
    Last edited: Mar 4, 2020
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Sounds like something that should be a bug report to Unity if you can reproduce it. You can just try saving the scene under a new name instead of renaming.
     
    RacingS0UL likes this.
  3. RacingS0UL

    RacingS0UL

    Joined:
    Feb 8, 2020
    Posts:
    2
    Will do it if I ever be able to reproduce it. So far, no luck.
    Thank you for advice!
     
  4. xach55

    xach55

    Joined:
    Apr 24, 2020
    Posts:
    1
    The same thing happened to me after renaming the scene it was completely empty. I found out that it was because of the name i gave to the scene that caused this issue after renaming, it went back to normal.
     
    Last edited: May 21, 2020
    Tonymotion and HakunaMytata like this.
  5. Vormike

    Vormike

    Joined:
    Mar 3, 2018
    Posts:
    1
    Unity 2019.3.13f1

    The same thing is happening to me. I cannot duplicate and rename a scene without losing everything in the new scene's hierarchy.
     
  6. templecake

    templecake

    Joined:
    Jan 25, 2020
    Posts:
    1
    just happened to me, didnt have backup for the new scene i was working on, lost the entire thing.
     
  7. transgwenderproud

    transgwenderproud

    Joined:
    May 25, 2020
    Posts:
    10
    Occurred to me too. Only affected my first level (simple thing), but I rebuilt it three times before realizing what was occurring. Work around for changing name has been to create a new scene with the new name, copy all items in the previous scene, paste it into the same location, and deleted the old. Bulky, but until the bug is fixed the only way to ensure it doesn't glitch out.

    Unity 2019.3.14f1
     
  8. Everwonderer

    Everwonderer

    Joined:
    Jun 26, 2020
    Posts:
    4
    Same issue here!
     
  9. christienleblond

    christienleblond

    Joined:
    Jul 6, 2018
    Posts:
    1
    same issue with 2020.1, renamed a scene from the assets folder and had to recreate my entire scene
     
  10. RalphWarom

    RalphWarom

    Joined:
    Nov 7, 2018
    Posts:
    1
    Lost me a good days worth of work to this.
     
  11. ameree2

    ameree2

    Joined:
    May 21, 2018
    Posts:
    9
    same here! 2020.1.3f1
     
  12. Thoma1207

    Thoma1207

    Joined:
    Dec 8, 2019
    Posts:
    2
    Me too, it was tragedy...
     
  13. BlobOfAwe

    BlobOfAwe

    Joined:
    Mar 23, 2020
    Posts:
    1
    Same thing happening to me. And if I try adding something to the scene, save, leave, and reopen the scene, it disappears. It doesn't save anything I add to it.

    It looks to me as if there's some background data to scenes that I don't know about.

    Essentially duplicate "SampleScene" which creates "SampleScene 1". Everything's fine, all is well. "I rename the Scene to "1", and everything vanishes from the hierarchy.
     
  14. kingpanks

    kingpanks

    Joined:
    Jul 13, 2018
    Posts:
    13
    Same bug here too
     
  15. FabienTT

    FabienTT

    Joined:
    Mar 2, 2013
    Posts:
    5
    Exactly the same as BlobOfAwe : It seems to be impossible for me to duplicate an existing scene. Tried multiple work around without success, it always ends up with an empty hierarchy.
     
  16. cotevelino

    cotevelino

    Joined:
    Jul 3, 2020
    Posts:
    5
    Hey all, I know it's a bit late for answer this but it happened to me many times and I found a easy solution.
    Apparently you can't name certain things to scenes, for example (Splash, Title). If you name a scene like that it will be completly empty. But if you name it Splashh or Titlee it is ok. I don't know why it happens neither how to fix it but I am telling you a way you can turn around it :)
     
    Riffar and vnl1a like this.
  17. vnl1a

    vnl1a

    Joined:
    Sep 8, 2020
    Posts:
    1
    tried @cotevelino solution and worked for me. I was not able to use "StartScene" without it emptying the scene but "MainMenuScene" was a-okay.
     
    Riffar likes this.
  18. andrekrit

    andrekrit

    Joined:
    Sep 11, 2020
    Posts:
    4
    I can't believe this happened to me as well. Luckily I could recreate the scene without too much effort, but it shouldn't have happened in the first place. I still amazes me how "fragile" Unity can be at times. How simply renaming a scene can result in the total, unrecoverable loss of the scene.
     
    Mango211104 likes this.
  19. LooksConfused

    LooksConfused

    Joined:
    Feb 17, 2020
    Posts:
    16
    I've been seeing this issue in 2019.4.9f1.

    Steps:
    1. Have a scene with some objects in it (lets call it SceneA).
    2. Duplicate SceneA (unity will automatically name the duplicate "SceneA 1".
    3. Rename SceneA 1 to SceneB.
    4. Switch to SceneB and now this will be an empty scene as described in the posts above.

    However, I found something interesting. If I after step 4 rename SceneB back to be called "SceneA 1", then all objects will reappear in the scene. So to me this indicates that it's probably an issue related to serialization/deserialization. Because the information are clearly saved somewhere since it can be recreated by reverting back to the Unity auto-generated name for the duplicate.
     
    rorymcguinness likes this.
  20. tom202020

    tom202020

    Joined:
    May 7, 2020
    Posts:
    1
    Hi, I think I have found an interesting workaround.
    3. Rename SceneA 1 to some other name. Find a "proper" name which will NOT cause this issue (via trial and error as mentioned above).
    4. Switch to new scene and it should have all objects as the original one
    5. Rename this new scene to SceneB, and now it should keep all objects as expected.

    Try this out, it works for me.
     
  21. robinch

    robinch

    Joined:
    Apr 30, 2019
    Posts:
    1
    I have yet another workaround that you can try.

    This worked for me on version 2020.1.6f1

    1. Rename the Scene back to it's original name and you will get everything back.
    2. Exit Unity and open it again.
    3. Rename your Scene to the name you want.
     
    Tonymotion likes this.
  22. spamRoast

    spamRoast

    Joined:
    Nov 18, 2018
    Posts:
    2
    I just encountered this too on a 2019 (whatever LTS version) project. All I did to make it work was to rename the scene to something that didn't wipe all of the objects in it, save the scene, close and reopen Unity, and then I was able to rename the scene to what I wanted without problem.

    The name I wanted to change to was a name I'd already used for the scene and through duplicating/renaming is when I noticed this bug, but doing the above seemed to fix everything.

    I bet this has something to do with the meta files, perhaps some sort of odd race condition.
     
    Tonymotion and tgrotte like this.
  23. tgrotte

    tgrotte

    Joined:
    Apr 17, 2019
    Posts:
    25
    I had the same problem. SpamRoast's first paragraph worked for me as well. My project is on 2019.4.13f1.
     
  24. Genero

    Genero

    Joined:
    Nov 14, 2012
    Posts:
    9
    This still happens in 2020.1.11f. robinch's solution with renaming the scene back to recover scene contents, restarting Unity and then changing the scene name, is a decent workaround.
     
  25. comicool

    comicool

    Joined:
    Nov 16, 2015
    Posts:
    6
    Hi all, I had this bug as well. When I renamed a scene "Level_Prototype", it would be broken and corrupt, when I did it with a name that didn't have the underscore "LevelPrototype" it was fine.
     
  26. RoopeKT

    RoopeKT

    Joined:
    Jun 29, 2020
    Posts:
    1
    My gameobjects disappeared as well (luckily nothing was lost permanently), but I was able to fix it by restarting the Editor after deleting the scene with broken name.

    Found this on issue tracker:
    Scene gameobjects disappear when renaming it to an already deleted scene name
    https://issuetracker.unity3d.com/is...en-a-scene-with-that-name-was-already-deleted
    In my case at least the broken scene name was indeed a name of a previously deleted scene.
     
  27. sonolil

    sonolil

    Joined:
    Mar 15, 2015
    Posts:
    14
    Same. Glad it wasn't anything too big of a scene.

    "Already deleted scene name" is the key as this is exactly what happend to me.

    ....It's been a year though? Granted I'm using 2019.3.19
     
  28. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    The issue linked above says it is fixed in 2021.2, which is still in alpha. It doesn't say if it is getting a backport, so I'd assume not unless they say otherwise.
     
  29. Codeyarch

    Codeyarch

    Joined:
    Feb 7, 2021
    Posts:
    1
    Hey there is a fix to this. Just save everything, close down the unity editor and reopen. When you reload everything should be fine :) I've had this bug on 3 different games I've worked on over the last few months and each time I've solved it by just reloading the editor. Just had the exact same bug again lol
     
  30. aaronrobbins

    aaronrobbins

    Joined:
    Dec 1, 2013
    Posts:
    1
    I believe this happens, at least sometimes, because you are renaming the scene to a scene name that exists in the build settings was deleted but is still pending final delation upon an editor restart. I think that's why @Codeyarch 's solution works, the restart purges the scenes names still waiting to be "totally" deleted.

    In short you maybe renaming your scene to a scene pending deletion.
     
    jacobfdunbar likes this.
  31. anish_aggarwal

    anish_aggarwal

    Joined:
    Dec 10, 2019
    Posts:
    3
    Solution:

    When you rename the scene an option will popup to reload or ignore, just select ignore and it will work just fine.
    Hope this one helps
     
  32. Alcedo93

    Alcedo93

    Joined:
    Jul 16, 2022
    Posts:
    1
    Hi All, I just want let you know this bug still occurs in 2021.3.3f1.
    I tried to rename the scene with the previous name, but I wasn't able to recover anything. Maybe this was due to the fact I closed Unity before to try the rename back technique. How knows?!
    However, you who are reading this post if you didn't close Unity yet try the rename back technique and please let us know if still works in 2021.3.
    Ah, what I would give to have known this thread before :)
     
  33. toastedshibe

    toastedshibe

    Joined:
    Mar 18, 2022
    Posts:
    1
    I also have the same issue. 2021.3.6f1
     
  34. HotDogMaker

    HotDogMaker

    Joined:
    Nov 18, 2023
    Posts:
    8
    I did the same thing and i think it's the best way