How can I fix a sound delay issue?

Dell7730Dell7730 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

  • AJaymzAJaymz Posts: 164
    Accepted Answer

    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

  • AJaymzAJaymz Member, PRO Posts: 164

    @dellagarpo is there a delay in the preview? Or is it on an Android or IOS device? I know Android has a delay.

  • Dell7730Dell7730 Member, PRO Posts: 388

    @AJaymz said:
    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

  • AJaymzAJaymz Member, PRO Posts: 164

    @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.

  • Dell7730Dell7730 Member, PRO Posts: 388

    @AJaymz said:
    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

  • AJaymzAJaymz Member, PRO Posts: 164

    @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.

  • Dell7730Dell7730 Member, PRO Posts: 388

    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

  • AJaymzAJaymz Member, PRO Posts: 164

    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.

  • Dell7730Dell7730 Member, PRO Posts: 388

    @AJaymz said:
    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

  • Dell7730Dell7730 Member, PRO Posts: 388

    @AJaymz said:
    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.

    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.

  • AJaymzAJaymz Member, PRO Posts: 164

    Good luck

  • Dell7730Dell7730 Member, PRO Posts: 388

    @AJaymz said:
    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.

    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

  • AJaymzAJaymz Member, PRO Posts: 164

    No prob

Sign In or Register to comment.