Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to make Audio Source on camera continue playing whilst changing scenes?

Discussion in 'Scripting' started by Tom13720, Apr 30, 2015.

  1. Tom13720

    Tom13720

    Joined:
    Apr 16, 2015
    Posts:
    6
    So I have the music file attached to the main camera as an Audio source, how would I make it continue playing the same music when It changes scenes?
     
  2. ThermalFusion

    ThermalFusion

    Joined:
    May 1, 2011
    Posts:
    906
  3. Tom13720

    Tom13720

    Joined:
    Apr 16, 2015
    Posts:
    6
    So do I do that just on the Camera?
    Also the camera is following a player from a 2D side scrolling perspective on some of the scenes and then its the menu camera on other parts, how would I change the camera like that but not let the music stop?
     
  4. ThermalFusion

    ThermalFusion

    Joined:
    May 1, 2011
    Posts:
    906
    No.
    Doing this on the camera would mean it survives level loads aswell, which is probably not what you want.
    You're probably best using some kind of singleton music manager (Plenty of of examples of Unity singletons around these forums)