You see, I want to make a background music in Unity but I want it to continue even so change the scene, you know if you can, and if so, how?
You see, I want to make a background music in Unity but I want it to continue even so change the scene, you know if you can, and if so, how?
Yes it is possible, the idea is that in your first scene you create the player object and add the following in your main script:
private static bool created = false;
void Awake()
{
if (!created)
{
DontDestroyOnLoad(this.gameObject);
created = true;
Debug.Log("Awake: " + this.gameObject);
}
}
This will allow your player to be always alive, therefore the player will continue between scenes ...