How to keep the audio from one scene to another in unity

2

I'm starting in unity and I wonder if it's possible to make the audio of one scene play in another, and that audio will play in the other scene, starting from the moment it stopped in the previous scene. If they know, please answer them well, please.

    
asked by anonymous 10.08.2016 / 23:50

2 answers

1

Just create a gameObject , put it to play the audio on it and create a script with:

void Awake()
{
    DontDestroyOnLoad(gameObject);
}
    
15.08.2016 / 19:02
0

First, create a script, in my SoundController example.

Within the script you create, place the

public class soundController : MonoBehaviour {


void Awake()
{
    DontDestroyOnLoad(this.gameObject);
}

After this drag the script to your object sound. It will work perfectly.

    
17.10.2018 / 15:37