Sound?

How do we use sound in defold on our new game?

Did you read the sound manual?

1 Like

Hey? Is there a way to download the sound script.

We have created a sound component and we puzzled on why the sound won’t play.

Are you a bot? If not please help us with finding the sound script.

If you have a game object with a sound component with id “boom” and a script component you would play the sound like this:

sound.play("#boom")

What does your code look like? Do you have any errors in the console?

Err, no. Although I think some other forum users may think so too from time to time.

9 Likes

We have no sound script so if you could do me a favor so i can keep my job, could you send me a sound script??

Ok, and the code in game.script to play the sound?

Could you do me a hugh favor?

There’s no need for a separate sound script. If you wish to play that sound then somewhere in game.script when the sound should be played add this line:

sound.play("#sound")

Oh ok much thx

where should i put it?

If you are worried about your job I would really recommend that you spend the necessary time needed to understand the code and Defold. Not let someone else to do your job for you.

4 Likes

I thankyou for helping this late at night

How would I know? If you need to play the sound when the player jumps put it with the code that makes the player jump. If you need to play the sound when the user clicks a button put the code there.

It’s morning. I’m on my way to the Defold office.

Ok thx

My bad different location i’m the only worker at the office

2 Likes