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
Related
I am making a 3d game in Unity for a school project and I have followed several online tutorials. I made a simple door in Blender, imported it to Unity, and placed it in the scene and it worked fine, but then after I made some minor changes to it and then placed the new finished door object into my assets, the door object "disappeared". The object is still there in the scene hierarchy but it does not show up in the scene or game view. Instead, it is just an outline if selected and is otherwise not visible. Outline of object
I looked online and could not find any similar occurrences and could not find any, so I tried unpacking the object (which I did not expect to do anything) as I am very new to Unity. I also tried placing the object into a new scene, and later a new project, but both did not work.
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 ?
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
Lets suppose I have a scene with several meshes like trees, boxes, etc. lets call it level 1.
After I finish playing level 1 I switch to level 2 like this.
SceneManager.LoadScene (1, LoadSceneMode.Single); //level2 scene index is 1
The thing is level 2 uses the same meshes level 1 uses. Do they get unloaded -> reloaded?
I'm not talking about DontDestroyOnLoad, as I dont need the same instances of the GameObjects in the level 2 scene.
I'm talking about the Model Data of each object (the meshes), not their instances. I know the instances are deleted, but I think Unity someway knows the next scene uses the same Meshes and keeps them. I just need to know if the Meshes are unloaded and reloaded when switching scene.
Objects that you don't call DontDestroyOnLoad on are destroyed once you change the scene using LoadScene (as if you called Destroy on them all), so yes the get reloaded. They are destroyed then (if they're present in the next scene) they're re-instantiated.
If you do edits to a specific object instantiated in a scene then these edits belong to this object.
If you load the same scene more than once then this specific object will have your edits. However if you load a different scene that has this prefab then the prefab will be a new one without the edits.
If you want all object instantiated to be like this object you have to edit the prefab. To do this you just click the "apply" button.
This will make all objects that become instantiated have the edits.
If you want some object to have the edits and some not to have them you make a separate prefab, just drag the "name" of this object from the hierarchy into your project folder. You've just created a new prefab and you can use it.
Also remember that this doesn't apply to edits done within the game. These are edits that you do (as a developer not as a gamer) in the scene view. Game view edits (for example if a player squishes a cube) are lost after game close.
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.