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

How to check scene number and use it in an If statement?

$
0
0
I have an audio that is set to DontDestroyOnLoad() but I want it to destroy on certain scenes, is it possible to check that and make the audio only DontDestroyOnLoad() if it is a certain scene? Here is my script currently: using UnityEngine; using System.Collections; public class dialogueclassicexist : MonoBehaviour { void Awake() { DontDestroyOnLoad(gameObject); } }

Viewing all articles
Browse latest Browse all 416

Trending Articles