Search Unity

Audio [SOLVED] How To Play Music And Sound Effects From C# Script?

Discussion in 'Audio & Video' started by JeZxLee, May 8, 2019.

  1. JeZxLee

    JeZxLee

    Joined:
    Jul 24, 2016
    Posts:
    222
    Hi,

    We are new to Unity.

    Have some questions:
    1. How do we play sound effects in C# code?
    2. How do we play music across scenes in C# code?
    (music would still play after scene change)
    3. How do we change volume of effects and music separately?

    We've Google'd a bit but have not seen good examples of above three questions.
    Let us know, thanks!

    Jesse
     
    Last edited: May 8, 2019
  2. JeZxLee

    JeZxLee

    Joined:
    Jul 24, 2016
    Posts:
    222
    Hi Again,

    We found what we needed on YouTube:


    Thanks!

    Jesse