Out-of-layout projectile sprites make noise on game start

0 favourites
  • 4 posts
From the Asset Store
Sound effects of monsters, ghosts, beasts and more
  • I have some projectile bullet sprite objects. They have a destroyoutsidelayout behavior. This prevents them from spawning in the layout when the game starts, but the player is still able to spawn them.

    I also have a sound that plays when these sprites are created, a shooting noise.

    Whenever the game starts, the noise happens too. I know this is because the sprites are stilled being created outside of the layout and thus, spawns a noise, even though they're destroyed instantly and are never seen.

    This has annoyed me far too long, especially now that I'm racking up different ability sprites with unique sounds. Getting tired of my ears getting blasted with five loud sounds at once that are coming from nowhere. How do I fix this?

    This is an example of what I'm talking about, from my editor.

  • You can put those sprites on another layout. Just create a new layout to hold all the sprites that you don't need at the start of the game.

    Or you could add a condition to the sound playing action to check that the sprite isn't outside the layout.

  • this works, thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I know this was already solved, but here's another method anyways.

    You could just add a 'Destroy when outside Layout' behaviour to them. Alternatively, you can add an 'Object is On-Screen' condition to the event line handling the audio for the object.

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