How to stop audio playing at game start

Hey everyone I’m a bit stuck here. I followed Ben’s code but the audio is just playing automatically at the start of the video without input, did I miss something? I already tried unchecking ‘play on awake’

Hi WandererXII,

Have you already compared your code to the Lecture Project Changes which can be found in the Resources of this lecture? Maybe the AudioSource gets played because of a missing if-block. A common mistake is a semicolon behind the parentheses of the if-condition.

this is my code

I’ve just noticed that when I am in play mode, in the console I get an error message when I press space “can not play a disabled audio source”. Which suggests the game is defaulting to just play the soundtrack on start. What am I suppose to do to ‘enable’ the source so I can get it to function how I want?

Check the Inspector of the rocket. Maybe the AudioSource component is disabled there.

Yes! I didn’t see that you have to check the box. Thank you Nina.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms