Tutorial Scripting Click Play Sound

This tutorial will show you how to play a sound when clicking on an object.. Make sure you checked out the basic guides for the Editor and Scene Wallpaper!


  • Open the Editor.
  • Get a background image for the wallpaper which you will import first.
  • Get a second image you want to click, for example this: Coin 0.png

Import the Image

Tutorial image import drag.png
Drag and drop the image into the editor.
Editor scene initial import options.png
The project name and scheme color will be automatically set, you can change them if you like. Press OK to import the image and create the wallpaper.
Tutorial image in editor.png
A new wallpaper will be created and the image should become visible.

Import Second Image

Tutorial script sound import second image.jpg
First, import the second image that you want to click for the sound effect. You can drag & drop the image into the editor as well.

Import Sound

Tutorial script sound import sound.jpg
Drag and drop the sound file into the editor.
Tutorial script sound sound settings.jpg
With the sound selected, set it to a name that is easy to remember and unique. Also set the sound mode to Single and activate the Start silent option at the bottom. This will keep the sound quiet and only play it once when activated.

Add Click to Play Sound Snippet

Tutorial script sound bind script.jpg
Select the image you want to be clickable again and choose to bind a script to it on the right.
Tutorial script sound choose snippet.jpg
Replace the entire script with the Click to Play Sound example snippet.
Tutorial script sound configure snippet.jpg
Now make sure to replace the name of the sound that the script refers to. In the example above, the name of the sound layer was coin.
Editor run script.jpg
Click OK and start the script preview at the top. Now you will be able to click the image you bound the script to and hear the sound effect.


Video with sound:

Community content is available under CC-BY-SA unless otherwise noted.