Quantcast
Channel: Questions in topic: "dontdestroyonload"
Viewing all articles
Browse latest Browse all 416

Can I create a scene DontDestroyOnLoad in editing mode??

$
0
0
I want some game object always exist in the game. Can I create a scene and the things which are in it don't be destroyed when I go to another scene. I have an idea but I wanna know if you guys have better method. Thanks in advance. the following is my method. 1.first create a scene and gameobject that you want them always exist. 2. create an empty gameobject and add the script. using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class gamemanager : MonoBehaviour { void Awake() { foreach (GameObject a in FindObjectsOfType()) DontDestroyOnLoad(a); SceneManager.LoadScene(1); } }

Viewing all articles
Browse latest Browse all 416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>