class in UnityEngine.SceneManagement for managing scenes in unity
Questions tagged [scene-manager]
56 questions
1
vote
0 answers
Having multiple scenes running in my Network game/demo in Unity
I have a 2D game/demo I am working on for learning purposes for Unity Networking and I have come to a predicament on how I should handle multiple scenes in my game because as we all know most games have more than 2 scenes and players are not always…

JoeyL
- 1,295
- 7
- 28
- 50
1
vote
1 answer
How to load/get to/from scene variables via loadlevel with scenemanager in unity3d programmatically
Since
Application.LoadLevel(level);
deprecated and new SceneManager is proposed, i am asking how to use it to load/get simple parameters like string type and in which functions of lifecycle would be best practise?(such as Start,…

Alp
- 1,863
- 1
- 20
- 38
1
vote
1 answer
Going to the next scene in the built index order
I have this piece of code for going to the next scene when the space pressed in built index order (for example , scene a is number 0 , scene b is number 1 and ... ) , but it doesn't work .
void Update () {
if (Input.GetKey (KeyCode.Space)) {
…

arshia9
- 11
- 2
0
votes
0 answers
Single Active Camera from main scene for multiple scenes in Unity 3D AR
I am stuck in a situation in my project. I will try to explain in as simple as possible.
In my project there are three scenes and I am trying to merge on a button click. And when the merge is occurring, I want this three scenes work with a single…

P D
- 23
- 8
0
votes
0 answers
Unity when touch phase ended in switch case scenario, it will return back to touch phase began when it moved to anoter scene
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class no1 : MonoBehaviour
{
[SerializeField]
private Transform no1bg;
private Vector2 initialPosition;
private float deltaX,deltaY;
public…
0
votes
2 answers
I'm trying to load scene by clicking button but when I write using UnityEngine.SceneManagement; it doesn't recognize the SceneManager.LoadScene line
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class MenuButton : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
//…
0
votes
1 answer
When loading the main menu scene in Unity, I need the player position to reset even if there's a playerprefs save
I need to reset the player's position in the main menu scene to 0,0,0, whether or not they have saved their playerprefs.
This is the code I'm using in Unity to reset the player's position when they exit to the Main Menu scene. This is a VR game. It…

yo_mama_
- 3
- 3
0
votes
1 answer
Data Persistence between Scenes in Unity creates multiple instances, regardless of conditional destroying of extra Game Objects
I am creating a game where the first scene will have a generated map saved as a 2D array, then the next scene takes care of all the combat. Once that's done, user needs to go back to the first scene and see the same map. I have followed Unity's…

Yakuman
- 173
- 9
0
votes
1 answer
Why does successive loadings of scenes take a very long time?
I have a simple 2D top-down adventure game.
There's a main level scene with houses.
The player can enter the house and when doing so it deletes the main scene and loads the house scene.
Respectively, when leaving the house, the player will load back…

narnia649
- 381
- 2
- 10
0
votes
2 answers
Why does activation phase of a scene being loaded in Unity take too much time?
I'm new to Unity3D. I am trying to make my own FPS game in Unity 2020.3. I have to make a lot of maps (scenes). So far I discovered a problem with LoadSceneAsync.
What I know from Unity docs: When AsyncOperation.progress variable is between 0 and…

Qwerty-uiop
- 21
- 1
- 7
0
votes
2 answers
Error with Fader during Scene Transitions
I successfully used a fader in a practice game I made a few months back. I am now trying to implement a similar approach for my mobile game.
My goal: when a user goes to the play screen, the screen fades out, loads the scene async, and fades back…

itsgalsugarfree
- 23
- 1
- 8
0
votes
1 answer
Unity - Scene Additive Not showing in final Build
so I'm having a problem.
I'm developing a game for our final project and I'm using scene load additive to load all the scenes). So the problem is... Everything works right when I test/play the game through the editor, all scenes are load as expected…

JSilva
- 3
- 2
0
votes
1 answer
transporting a bool across scene's while changing it
For my game you need to complete a mini-game to unlock abilities. But I atually have no clue how to do it cause the value gets resetted to false whenever I load the main-level.
Code playerMovement:
static bool FistAttackEnabled;
void Update ()
{
…

Remco.d.jong
- 31
- 8
0
votes
1 answer
Unity SceneManager loads scene, Start / Awake do not run on load
I have a StartupScript that i want to run every time when a scene (re)loads.
When I load Scene 1 the script runs.
When I load Scene 2 the script runs.
When I go back to Scene 1 the script does not run.
How can i force the StartupScript to run every…

Rob G
- 123
- 3
- 15
0
votes
1 answer
Can i change the scene (value?) via public void or something? I do not want to make a new code everytime and change the scene that is going to load
This is the code i am using. It switches to another scene if the goal gets touched by an objekt with the right tag. Now I want to know how i can change the numbers of the scenes via unity without opening the code.
using…

Ghoast
- 29
- 4