[Solved] How do I make a sound play only once?

0 favourites
  • 5 posts
From the Asset Store
Change the size and position of everything without calculating anything!
  • I want a jump sound to play when the player sprite jumps, but when I tried to set that up the sound ended up playing on loop the entire time it was in the air.

    While I have gotten it to Sort of work (the sound doesn't play when jumping multiple times with little time in between), there must be a better way.

    Here's what I have right now.

    <img src="http://img600.imageshack.us/img600/5285/jumpexample.png" border="0" />

    Thanks for any help. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Add a 'trigger once' condition. The event sheet is read once every tick (~60 times a second) so if you use a condition like 'is jumping', it is checked and true constantly, 60 times a second. If you put a play sound action in an event like that, it will play 60 sounds a second, which will sound pretty awful.

    Adding a 'trigger once' condition beneath it turns it in to a trigger.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ah, thank you Ashley! Works perfectly.

    Cheers <img src="smileys/smiley1.gif" border="0" align="middle" />

  • All good evening, I'm making a game, and I need to reproduce the sound from the change only once, but the trigger just does not help, since it turns off the repetition of actions with the variable, what should I do? (Sorry for my broken English, I did not learn this language)

  • All good evening, I'm making a game, and I need to reproduce the sound from the change only once, but the trigger just does not help, since it turns off the repetition of actions with the variable, what should I do? (Sorry for my broken English, I did not learn this language)

    Please do not multi-post the same query. You have already asked this here - https://www.scirra.com/forum/viewtopic.php?f=147&t=201276 - no need to resurrect a thread that is over 6 years old.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)