How can I fix a sound delay issue?
Dell7730
Member, PRO Posts: 388
When two actors collide, the sound that was assigned to play on contact has a delay of almost a second.
Best Answer
-
AJaymz Posts: 164
If it still has multiple soundeffects, then may need to put a timer in to reset the self.SoundEffect, or reset it to false some other way, like when your actor is a a stance after throwing a punch or however your actors are fighting.
Answers
@dellagarpo is there a delay in the preview? Or is it on an Android or IOS device? I know Android has a delay.
On Android phone
@dellagarpo yes there will be a slight delay. About a second seems kind of long though. Is it possible you have a square or rectangle actor set to Circle Collision? the collision point may look different when colliding.
both have circle
@dellagarpo If a sound effect is all you want to accomplish out of the colliding actors, then possibly making a bigger alpha picture with your actor image in the middle, that will make the collision appear later, which will make it closer to your sound. But it depends on what all you have going on in your game.
I actually like the idea, in my game, the two actors are like head to head boxing each other, so it triggers countless sound effects, sometime, when one actor is already destroyed, there are still sound playing
A collision can occur multiple times between actors. So a good way to make 1 sound at a time is to make a self boolean attribute.
Rule - when collides: change self.SoundEffect to true.
Rule - when self.SoundEffect is true: play sound (run to completion checked)
Change self.SoundEffect to false.
i'll try that, thanks for the suggestion, i'll let you know what happens as soon as possible
So far it's working great on computer preview, trying to get the apk now for the phone and let's see how it goes, i'll let you know soon.
Good luck
Sorry for the delayed response, yeah it still has a delay but a lot less now, oh well, can't get every thing you ask for... thanks again
No prob