i would like to know how to destroy (DontDestroyOnLoad) to use diferent music for menu and for gameplay
i add a bool in my script
thanks if anyone can help me
i would like to know how to destroy (DontDestroyOnLoad) to use diferent music for menu and for gameplay
i add a bool in my script
thanks if anyone can help me
Hi Gabus19,
That’s an interesting idea. With a little bit of research, I’m sure you’ll be able to make this work.
Here is a little tip for you: Look the sceneLoaded
delegate up in the Unity API, read the example and try to apply the example in your code. Do not write the complete solution immediately. Instead, log messages into your console to see if the expected code blocks get executed. Once they get executed as expected, you can play your sounds as needed.
Good luck!
See also:
thanks for you tip, but i dont understand yet how to use the sceneLoaded , anyway i found another solution, i create diferents audiosource as AudioPlayer childs and i just activate and desactivate.
seems like is working nice,
Good job on finding an alternative solution!
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.