How do I fix the sound?

0 favourites
  • 5 posts
From the Asset Store
Best soundtracks for any game. High quality and engaging assets.
  • I have 2 layouts

    When the first layout strated then the music start automatic.

    If I touch the mute gomb then the music muted and set muted to 1

    something else set muted to 0 this is works fine, but only on one layout.

    If I go to second layout and come back to first layout then start the music automatic and now play together the 2 track, it is very annoying.

    So how can I set up when I go to the second layout from the first layout and come back from the second layout for the first layout then do not start the music again and do not play together the two track, only just the one track play. And if I stop the music on the first layout and go to second layout then do not play the music.

    Thank you!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use a global variable to determine which music is played and global variables work in all layouts.

    So you need a global variable and call it MusicControl

    Then when you go to layout 2 and want a certain music stopped in the event where you go back to layout one set MusicControl=1.

    Now in layout 1 you use that variable to tell which music you want played or for no music.

    On MusicControl =1: Stop all Sounds

  • Hi!

    Thank you for your info.

    I do not understend all what you wrote yan you write me the commands.

    Currently it looks like this:

    Layout 1.

    When start the layout then the music automatic play

    When touched pause button then Set 1 Muted Variable =stop all music

    Someone else Set 0 and play music

    Layout 2.

    When touched the back buton go back to Layout 1 and start the music and now play 2 track together.

    So if I create a global variables and connect the layout 1 and layout 2 then how need to be looks like?

    Who can I reach with this when the app started then the music will automatic play?

    An I want to if the user like the music then can listen on layout 1 and on layout 2 so the music only stop if the user want to touch the mute button.

  • You will need to take the music out of the ON Start Of Layout or it will always start playing when you return to layout 1

    Global Variable MusicControl = 0

    On MusicControl = 0: Play Music

    On MusicCntrol= = 1: Mute Music

    On Pause Button Pressed: Set MusicControl = 1

    On Play Button Pressed: Set MusicControl = 0

    That will allow you to control the music when you go back and forth between layouts using just one variable.

  • Thx I solved meanwhile.

    I created a layout 3 which is the same as layout 1 expect here do not start the music when started the layout

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