arrow_back Monster Noise
In the core project, you programmed your monster to say a statement and animate at the same time.
In this add-on, you’ll add a sound parameter that is associated with the emotion of the monster.
To start, click on the sounds tab.
Add a sound to play for the happy, angry, and sad emotions.
This example adds the “laugh-female” sound for happy, “string accent” for sad, and “screech” for angry.
Click back to the scripts tab, and drag out a “play sound” block.
When clicked, it plays the sound you added to the sound menu.
To play this sound at the same time your monster says a statement and expresses an emotion, add another input to the define “show feelings” block.
Right click to edit, then select “string input” from the options menu.
Name the string something that describes the sound action.
This example names it “sound.”
If an extra text box appears, go ahead and delete it.
You created a sound parameter for the “show feelings” block!
Put the “play sound” block under the “say” block, then add the “sound” parameter inside the “play sound” block.
Finally, type the sound that will play in the input space you just coded for the “show feelings” block.
Test your code.
The sound plays with the wrong animation.
To fix this, move the “play sound” block above the “say” block.
Now, it’s your turn.
Add a sound parameter to your “show feelings” block, then write the new sound in the new input space.