using UnityEngine; public class KeepGameObject : MonoBehaviour { void Start() { // GameObject won't be deleted on scene switch DontDestroyOnLoad(this.gameObject); } }