GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Noob Question but please help

Hi everyone,
I am quite new (as you can probably tell) and I have been trying to make a soundboard just for fun.
Any way I am trying to make it so when you click an actor it will play a sound. I add the mouse click and play sound but it plays the sound no matter where I click. Could someone please tell me how to make it so when I click on the small box (the actor) it will play a sound.

Thank you

Comments

  • gyroscopegyroscope I am here.Posts: 6,243Member, Sous Chef, PRO
    edited November 2012
    @WhAmm

    Hi, are you using a background image as well? Make sure that has no Rules in it. and in each of your actors you want to trigger sounds, put into each:

    When mouse is down ----if you're not going to make this app for desktop, so just for mobile device, then use When Touch is pressed ---
    Play Sound

    You've probably got this already but my guess is its in the background actor as well... (which you don't want, as I say). Hope that sorts it for you.

    And welcome to GSC and the Forums! :-)
  • WhAmmWhAmm Posts: 4Member
    Thanks for the Welcome :D
    I tried all that and it is still doing it the background (which is an actor has nothing on it)
    and even if I delete everything else except the actor with the rules it still plays the sound no matter were you click on the page :(
  • Bilal15Bilal15 Posts: 35Member
    ok try this make sure you delete all your rules and then try it again how @gyroscope said because sometimes when im working on something i will accidently make a problem half way through and sometimes the best thing to do is start again.

    hopefully i helped

    Bilal
  • WhAmmWhAmm Posts: 4Member
    I have been trying different ways but I am still getting the same problem.
    I must be doing somthing wrong even if I have no background image and all I do is put 1 actor down and have its rules as
    When Mouse is down
    Play sound
    When I click the play button and test the app no matter were I click on the screen it will play the sound :(
  • SlickZeroSlickZero Posts: 2,815Member, Sous Chef, PRO
    You need to add another condition to your rule. Click the "+" button, and have it look like this -

    When *All* conditions are valid

    When Actor Receives Event *mouse position* is *inside*
    When Actor Receives Event *touch is pressed*

    Play Sound *whatever*
  • gyroscopegyroscope I am here.Posts: 6,243Member, Sous Chef, PRO
    edited November 2012

    Hi @WhAmm

    As @SlickZero said (which I forgot to mention): if you are making a game/app for the Mac desktop, then you would use "When mouse is down" and you'd also need "When actor receives event mouse position is inside" because you are basically saying, when a user clicks the mouse...anywhere on screen... then whatever happens.

    To make it more clear, If you are making games/apps for devices, then you can use "when touch is pressed" instead/only, except where two actors are overlapping/covering, then you'll get both "when touch is pressed" rules happening.

    So to summarise, if you're making for devices, and your actor is not overlapping any other actor with a touch rule in it, all you need in your actor is:

    When touch is pressed
    Play Sound

    Hope that's cleared it a bit more for you.
  • WhAmmWhAmm Posts: 4Member
    Ohhhhhh thanks heaps
    works great now :D
Sign In or Register to comment.