I just started using Unity, made some progress and built a scene with some prefabs and logic.
While importing some package I downloaded via the package manager, I was asked if I want to open a new scene. Sadly I pressed yes, not knowing that it would erase my previous scene.
I was constantly pressing CTRL+S to save while working on my original scene, however I couldn't find any option to go back to my scene from this new scene.
Needless to say that countless CTRL-Z hits did not help.
It seems like the new scene replaced the SampleScene.unity file my original scene was saved in.
Is there anything I can do to recover the scene ?
Related
I'm a beginner in unity and programming, I was following a video for making a Flappy Bird game. Everything works perfectly but when I run the game, I get a floppy disk icon middle of the screen and somehing called DontDestroyOnLoad starts working out of nowhere. I couldn't find or understand anything on google when I search for it. I'm posting the screenshots in case anybody wanna see it.
This icon and dontdestroyonload thing only appears when game is being run:
There's a little button in the type right of your scene and game view called "Gizmos", un-toggle that button, should fix your issue.
Also don't worry, Gizmos can only be seen in the Unity Editor for level editing and debugging purposes --> if you were to build the game, for instance on IOS, they would disappear.
(if this doesn't fix your issue, then I would just create a new scene and copy your gameobjects over one-by-one)
I see someone responded about the main part of a problem, but I'll clarify about dontdestroyonload
Don't destroy on load is collection of objects that won't be destroyed when new scene will be loaded, usually objects there come from running them through DontDestroyOnLoad method somewhere in a script, however I noticed that some time ago Unity creators started to put there some stuff related to built-in tools (like debug)
I am developing a game with Unity Collab in the last months, but always on one scene. Now that I want to create a new scene some things happen:
lighting settings are not shared (it is not a big deal because I can do them again)
every object that I add or copy from the other scene is appearing, but if I change the scene and go back here again there is nothing. My friends on collab actually see objects in it, and also the lights like the other scene but mine is always empty
What should I do?
Always empty like that
I'm a newbie in Unity.
As it is said in the title, I have lost all my scene after I have loaded an imported asset (that has as extension .untiy) without knowing that it will replace the whole scene.
And even If I ctrl + z on it, it has not put me back to the old scene.
I have imported a tree from the asset store and then I went into that folder (from Unity), always by not knowing the effect that it will have, I opened the Scene folder of that asset and tried to put it in my scene so I did it too quickly that I missed to read what was written on the dialog window. Then all my scene was replaced by that one. I thought that I could restore it by doing ctrl + z but it is not doing that at all.
For now I have left the Unity window opened on purpose in case I could still get it back.
Hope someone could help me because I don't want to spend much time to restart it from zero.
What happened is that you only opened the new Scene in the Scene view. Most probably by double-clicking it instead of drag&drop it.
As long as you saved your original scene as an asset to the Assets folder that's easy to revert: Simply go to your original Scene in the Assets folder, double-click it and you should be fine ;)
Btw in order to import objects from one scene into another you can
create a Prefab and drag it into your scene
load both scenes into the Scene view next to each other by drag&drop. Then you can simply drag objects between both scenes.
I have problem with Unity prefabs. Every time I create a nice looking UI in main scene and I want to store it as prefab for later usage if I open this prefab it's deformed(random cliping, moved UI elements in different directions, ... such a mess). If I try to fix this prefab in prefab editor to make it nice looking like before and then if I insert this back to scene it's totally unusable. It creates bigger mess than before in prefab editor... I don't know what to do. Editor throws no errors btw.
In first image is nice looking UI(example already created). In 2nd image is prefab editor. Text is totally out of panel and 3rd is from back in scene (means removed old one UI and place stored prefab from folder) the panel is gone.
Imgur - images are orded by scene to prefab editor and back to scene
On those images you can see a 3 elements... but if I make more complex UI, it's clipping through each other in prefab editor and also back in scene.
Unity version: 2019.1.7f1
When I build Unity project I saw that if I add current scene Unity or not the game still run fine.
So what is the purpose of add scene ?
If you have not added any scenes then unity will build with your current opened scene by default. The purpose of adding scene is to handle among multiple scenes like Main Menu, Store, Gameplay, Gameover etc. To get more than one scene, you have to add all the relevant scenes, otherwise unity will not recognise the scene when you want to switch to another scene.
As long as #Hamza Hasan answer is correct, I think that question author means something diffrent.
He asks why he should add scene if it works fine in Editor without this action.
So the answer is, if this scene is not first default one (and it is your case), you wont be able to load it programaticaly, as it wasnt included into build even if it works in Editor. It works in Editor couse it was loaded into memory opening the scene.