Play sound issue when actors collide
Hi guys,
I've been stuck on this for hours now.
I have a game where you speed a car up to cross an intersection safely, and if it crashes into other cars, I want a sound to play. (A crash sound)
Here's the trouble. I have used the following rules:
(Inside the main car actor)
'Actor receives event: overlaps or collides with, actor with tag, All other cars (which are all the other actors moving around)
Play sound: Crash sound'
But no matter what I try, the crash sound simply will not play.
However, if I put a stationary actor, lets call it, "Brick wall" in front of the main actor and use the exact same rules, the sound plays no problem. Its like when my main actor collides with the other cars, they aren't actually colliding...but they have to be seeing as I have a rule that turns their pictures into fiery explosions and brings up the game over screen, and that all works perfectly. The ONLY thing that wont work is the sound.
Any ideas at all?
Thanks for your time.
Comments
The cars are probably only colliding very very briefly at the monent of impact, so they only overlap for a tiny fraction of a second and are then instantly back to not overlapping, so your sound only plays for a tiny fraction of a second, not long enough to even hear, especially if the sound has a slight attack on it (even just a few samples), if this is the case and you've not already checked 'run to completion' then try switching that on.
That is a good point @Socks , unfortunately I have tried it with and without 'run to completion'. Nothing seems to work.
Then try making an attribute that changes when the collision happens, then have rule that plays the sound when the attribute changes.
Ok cool. Would a Boolean be best to use in this situation?
Yes.
Hey @Socks ,
So I've tried with the Boolean attribute a bunch of different ways, but I think I must be setting it up wrong.
If you have a moment, could you please show me how you'd set it up? This is really getting me!
Thanks
I would simply have:
When actor A collides with actor B then play sound ('run to completion')
No luck @Socks
@Chr0nos try it with a different sound effect that you know works. Just to see if something is wrong with the sound you want.
Tried that too Ajaymz. Its so strange.
I just cant get this particular scenario working.