what function call by update ?

my game is over when tranfrom.possition.y<3f and i add in function Update but now i want add audio.playoneshot ,it not work by update alway call . how can i fix

@Doug_B can you help me ,i fix done my ads ^^

Excellent news! Well done. :smile:

If I understand you correctly, you want to play a sound when the game is over. You only want the sound to play once. Is that correct?

If so, then you could add bool m_hasEndMusicPlayed; and only play the audio if that value is false (obviously set it to true when playing the audio for the first time).

thank you so much , so how play audio music ? when i play music on , and if(tranfrom.positon.y<3f){ music off , dead audio on} ?

You just need to follow the Unity instructions on how to do this. You should have an audio listener attached to your main camera by default which will pick up the audio when it is played.

thank you ,i did . i use a variable bool to check and it work ^^

1 Like