How do I play a sound only one time?

0 favourites
  • 5 posts
From the Asset Store
A complete set of Graphic, User Interface element to build 2D mobile game or PC game.
  • In my game, a boss portal appears for a given score. When it appears, I want a sound to play only once. How can I do that?

    if I do on created: the sound plays endless

    if I do on 10 or more score: the sound play endless

    if I compare coordinates: the sound plays endless

    Does construct havent a: play once function?

    Please help me :)

  • if I do on created: the sound plays endless

    This should do the trick actually. Have you set the sound to loop by accident?

    If that´s not it, another thing I could think of is that the boss portal gets created over and over insead of only once, this would also explain why the sound plays over and over.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I give you a screenshot. Maybe cou can help me better now.

    I think the best way would be to create the portal, but have construct a create only once time function? :D

    I cant do Punkte=1000 because the player get sometimes for example from 999 to 1001 points.

    the collision with the player work 1 time :)

    how can i do the same for the position (or create) portal

  • Ah yes, so if you do "punkte >= 1000" this will be true every tick. Your entire event sheet will be executed every tick (usually 60 times per second) so of course your portal will be created 60 times per second. You can use "System > Trigger once" to only create it a single time.

  • Thank you, it works fine !!! ;) nice to know the trigger once function.

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