So I made a platform game and now I have a sound problem. I made events like if a rolling stone overlapps some special places, you can hear a sound.
Yeah thats fine, but I just wonna hear the soundeffect when the player is in the window where the event happens. Now you can hear the "rolling stone"
all over the level. How can I make it, to hear the soundeffects just when the player is in the near or on the window? Thanks !
In the event that you made to play the sound, create another condition:
System: Pick by comparison->Object: Stone Expression: distance(Stone.X,Stone.Y,Player.X,Player.Y) < *distance in pixels where you don't want to hear the sound*
Remember to place that as the first condition.
Alternatively use Stone -> 'Is On-Screen', but then it won't work if it happens even a little outside the visible area.
Develop games in your browser. Powerful, performant & highly capable.
Thanks VValt !