Sound FX doesn't play on collision
Hunnenkoenig
Member Posts: 1,173
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?
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
Try changing it so the sound will play in the ball actor.
Basically just do what rebumb says.
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 :-)
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....
Having the ball generate the brick effects is probably what is causing your single sound issue.
I will try that too.
You were right.
I had some problems first, because my bricks have very complex rulesets, but then I managed to do it right.
Thanks
___________________________________________________________
(JetPacked!) http://itunes.apple.com/us/app/jetpacked/id361063574?mt=8
___________________________________________________________
(JetPacked! HD) http://itunes.apple.com/us/app/jetpacked-hd/id365205067?mt=8
So:
Rule
When [an event is triggered]
-----Play Sound
-----Timer After 0.1 secs
----------[do something else]