Answers for "how to change scenes in unity"

C#
2

how to change scenes in unity

using System.Collections; 
using System.Collections.Generic; 
using UnityEngine; 
using UnityEngine.SceneManagement;

public class SceneScript {
  public void ChangeScene(string scene = "") {
    SceneManager.LoadScene(sceneName:"scenes Name");
  }
}
Posted by: Guest on May-09-2021
13

unity load scene

using UnityEngine.SceneManagement;

int buildIndex = 0;
//Load the scene with a build index
SceneManager.LoadScene(buildIndex);
Posted by: Guest on April-18-2020
6

how to switch scenes unity

SceneManager.LoadScene("MyScene");
Posted by: Guest on December-09-2019
2

how to switch scenes in unity

using System.Collections; 
using System.Collections.Generic; 
using UnityEngine; 
using UnityEngine.SceneManagement;

//Load based on name of scene
public class SceneScript {
  public void ChangeScene(string scene = "") {
    SceneManager.LoadScene(sceneName:"scenes Name");
  }
}
Posted by: Guest on March-15-2020
1

how to change scenes on collision unity

void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Player")
         SceneManager.LoadScene (2);
 }
Posted by: Guest on August-02-2021
2

how to change scenes in unity

SceneManager.LoadScene(scenename);
Posted by: Guest on May-27-2020

C# Answers by Framework

Browse Popular Code Answers by Language