Unity 5 does not create new scene - c#

I'm newbie to Unity 5 and I have problem with creating new scenes. After creating a project ,I go to File->New Scene but the scene does not appear at all so I can't do anything with it ! Here's the image from what I see in Unity:

Your new scene is there. Your layout is likely messed up.
Click on the Default in the image above(where red arrow points to) then click Default. It should reset everything to normal. You can press Control + S to actually save the scene.

Hit Layout in the top right corner, select "2 by 3"
You will see your scene and game view quickly that way.

Have you enabled the scene view and switched to it?
Maybe you are viewing the game view. There is nothing in the scene so nothing will be displayed in game view.

Related

dont unload scene when switching to another scene

i have 2 scene in my program, when click a button go to the second scene and when press home button (in the second scene) go to the previous scene, how can keep loaded the first scene? I tried the Scene Manager additive mode but it shows both scenes together, how can i do this?
If you want to keep the first scene loaded but hidden when the second scene is shown, it is not possible. But what you might want to try is to use SceneManager.LoadSceneAsync when you call the first scene from the second scene
I don't know the code but i am pretty sure you can find all the children of the scene make them setActive(false) and make everything hidden.
You need to use Scene Manager additive mode ofcourse.

Trying to totally reload scene

I made a scene that represents the main menu of a game. In this menu there is an option for single player, and, when I press it, it opens a new "level 1" scene.
Also, there is a pause menu that allows the player to quit the game and get back to the main menu.
However, after it backs to the main menu, when I try to get into the level 1 scene using SceneManager.LoadScene("level 1"), it makes a lot of problems. It means that a lot of game objects don't act like they should.
I dont know why it happened, and I would appreciate if someone can help me solve it. Thank you.
You can use SceneManager.LoadScene("level 1", LoadSceneMode.Single); to clear the old scene and only load the new one in, which will let you get a clear scene and shouldn't have any problems.
If you have scripts that need to last into the new scene, you can use DontDestroyOnLoad(this); in your scripts and they will move into the new scene. The problem is you have to make sure your scripts that aren't being destroyed don't try and access destroyed objects. From your comment it looks like you have a player movement controller that isn't being destroyed, or it's being created in the menu scene and it doesn't have it's references updated correctly when the scene is reloaded. You can also use Destroy(this); in your scripts that are saved through scene changes to get rid of them when they're done running.

Unity Dota style loading screen

I'm creating a 3v3 multiplayer game and I'm stuck on an important part before the gameplay comes in.
I was wondering how you would approach creating a Dota 2 style loading screen for loading characters into the game (Picture below).
Creating the UI isn't the problem. The problem is animating it to look clean while also having it actually load the game (terrain/gameobjects/etc) with a progress bar or something.
I load the level with this
PhotonNetwork.LoadLevel('Game');
Then a gameobject spawns each player with
PhotonNetwork.Instantiate('....');
This works pretty well with nothing in the scene other than a plane to walk on. Now I just need to create the loading screen BEFORE the character loads while actually loading the terrain/objects/etc.
If anyone could point me in the right direction I would really appreciate it.
Thank you
Dota 2 style loading screen example:
I think this is a perfect case to use for Scriptable Objects in Unity.
Because as far as i remember there are around 100 heroes in Dota 2 and only 10 of them will be picked. So the images in this loading screen would change based on player input. Therefore, you should create scriptable objects. Then you can change the image(hero) also modify/add nick names to it in Run time. So to sum up you will have 10(in Dota but 6 is your case) scriptable object in your scene but you will only modify the images and nicknames after player selects the heroes.
Another benefit would be since they are objects you can easily animate them move up and down adjust however you want.
Here is a tutorial from Brackeys that is perfect for your case. Good luck!

Animating an image not playing in game scene

I am trying to make an animation of a countdown.
I first made a Gameobject, created a canvas for it, and inside that canvas I created a UI Image, attached an image to it, and finally created an animation with that image.
Everything is working fine except the animation is not showing in game scene but only in normal scene, but when I go to that UI Image component and start the game I can see the image changing which means that its not the animation but something else.
Does anyone have an idea of what's going on?
There are several possibilities. Depending on if the image is showing up at all, you can check if your UI image is anchored correctly (four triangle marks) or pivot position is where you want it (circle mark). Depending on how this is done, if you Game window resizes in play-mode with the display set to Free Aspect, your image may move off the visible screen or, in some cases, get crushed which usually shows up as a red X in the editor. I can see this happening if your Game window is set to Maximize on Play.

Scene is not loading properly

I have 2 scenes in my game. 1st for menu and 2nd for Game itself. There is one button on screen called "Play". This button will let player load Game Scene. And if user press Escape from Game Scene, it will load Main Menu. I've uploaded code for it below,
if (Input.GetKeyDown (KeyCode.Escape)) {
SceneManager.LoadScene ("Menu");
}
The above code(Written in Update()) exits the Game Scene, But The player remains on screen. And so if I again press Play, the Game Scene does not display player. I've searched for it much, but I can't find any understandable reason. Can anyone help me please.
The problem could be that you have called DontDestroyOnLoad(player) somewhere.
Have you tried making a different scene and loading that one to test if that also happens?

Categories