Sound FX doesn't play on collision

HunnenkoenigHunnenkoenig Member Posts: 1,173
edited November -1 in Working with GS (Mac)
New day, new problems.

My wallbreaker game is ill again.

I have a brick and I say "if ball hits you, play sound X". The ball hits the brick, but no sound is playing. What's wrong?

I have another rule on the ball, where a sparkle anim is spawned when the ball hits the racket. I placed a sound in the sparkle actor, so when it spawns, it plays the sound. Works fine.

Why my brick sound doesn't work?

Comments

  • rebumprebump Member Posts: 1,058
    I usually have to click "Play to completion" for sounds activated upon collision. If the brick is destroying itself, you need to put a very short timer in to hold the destroy statement...so fire off your sound, wait a short bit, then destroy the actor.
  • dereklaruedereklarue Member Posts: 121
    If your destroying the Actor that plays a sound the sound will not play.
    Try changing it so the sound will play in the ball actor.
    Basically just do what rebumb says. :)
  • HunnenkoenigHunnenkoenig Member Posts: 1,173
    rebump, you are a true enrichment to this forum :-)

    I actually destroy the actor by spawning a destroy animation.
    I will try to delay the destroy command after I have slept a bit :-)
    Now I turned my PC off, because I had enough :-)

    But I think, that will be the solution.
    Thanks!

    @dereklarue: thanks! Also a good solution to try :-)
  • HunnenkoenigHunnenkoenig Member Posts: 1,173
    Aaaand the wiiiinneeeer iiiiis.......DEREKLAURUEEEEEEE :-)

    I added the sound to the ball and it works immediately.
    I don't need to mess with delays and timers and such :-)

    I feel so stupid.... :-)

    The only problem is, it plays only one sound at once and if the ball hits 2 or 3 bricks it gives only one sound. But maybe it is better so....
  • rebumprebump Member Posts: 1,058
    Actually, you probably want the bricks to trigger their own sound effects (using the timer delay before the destroy) so that you do get multiple brick sounds at once or nearly at once (in the case of the ball hitting a few bricks in quick succession).

    Having the ball generate the brick effects is probably what is causing your single sound issue.
  • HunnenkoenigHunnenkoenig Member Posts: 1,173
    rebump thx,

    I will try that too.
  • HunnenkoenigHunnenkoenig Member Posts: 1,173
    So, I changed it with time delay, and now it is perfect.
    You were right.

    I had some problems first, because my bricks have very complex rulesets, but then I managed to do it right.

    Thanks
  • JGary321JGary321 Member Posts: 1,246
    Yea, a .1 timer solves A LOT of issues =)
  • BaDDAppleBaDDApple Member Posts: 49
    newbie question. Where do you add the timer? I'm having the same problem.
  • chosenonestudioschosenonestudios Member Posts: 1,714
    @baddapple: once you open up one of your actors, scroll down and click on behaviors and then scroll all the way down to the bottom and there the timer is. Good Luck! :)

    ___________________________________________________________
    (JetPacked!) http://itunes.apple.com/us/app/jetpacked/id361063574?mt=8
    ___________________________________________________________
    (JetPacked! HD) http://itunes.apple.com/us/app/jetpacked-hd/id365205067?mt=8
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Add the Timer to the Rule.

    So:

    Rule
    When [an event is triggered]
    -----Play Sound
    -----Timer After 0.1 secs
    ----------[do something else]
  • BaDDAppleBaDDApple Member Posts: 49
    Thank you everyone for your help.
Sign In or Register to comment.