How do I fix the music?

0 favourites
  • 3 posts
From the Asset Store
6 looping tracks to use in your games and projects. These tracks are in the style of the 1960s detective movie genre.
  • C3/Mobile App/

    I uploaded background music

    When I do: On start of layout > Audio > Play > Music

    The music plays perfectly. No problems.

    But when I do: System > Compare Variable > play = 1 > Audio > Play > Music

    When play does = 1 it sounds like my laptop is about to explode. I'm not sure I'd call it static, more like the entire audio file is skipping.

    I tried to preload the music on start of layout, but that didn't help.

    I tried with a fresh brand new project but the results are the same.

    If the music starts on the start of layout everything is perfect, but if the music starts when play=1 it's just noise.

    Thoughts?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You probably need to add a "Run once", or test to see if the music is already playing. What's happening now is that is that every frame, the game is checking to see if play=1, and then playing the music. Every frame (because play still = 1 on the next frame, and on the frame after that...). Hence the horrible output you're experiencing!

    You need to tell it to check ONCE, or stop checking when the music is already playing.

  • mikehive

    Thank you.

    I forgot that bit.

    I keep thinking game ignores a variable unless it changes. Which I know isn't true, but I forget that time and time again.

    Thanks again.

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