[Solved]Problem with Time Scale

0 favourites
  • 7 posts
From the Asset Store
Time rewind like in "Braid". Choose objects that will be affected by time rewind
  • Hey!

    I am trying to make a pause menu and, well, take a look at my code.

    <img src="http://img89.imageshack.us/img89/3158/hx68.png" border="0" />

    I can press the menu button and it pauses the game and displays the pause menu. But when I press the menu button again, the pause menu will not disappear and the time scale will not set it self back to 1.0.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Before the action "Set time scale to 1.0", put a "Wait 0" action. :)

  • Easiest way to fix this is to replace the is not visible by system else.

    This is actually the best example for a place to use the system else event.

    Another way, of which I'm fond myself to make the toggle is:

    on button touched : system set timescale : 1-timescale

    this way

    when timescale = 1, 1-1 returns 0

    when timescale = 0, 1-0 returns 1

  • Jase00 that just broke the button. Now it does nothing.

    LittleStain I am not how that would work exactly.

  • Right click on the is not visible event, choose replace condition, make it system else.

    or do you mean the second one?

    just add the set timescale : 1-timescale

    to the on left button clicked event as the action and remove the subevents.

  • Tekniko

    I suggest you to try the system condition 'Else' instead of (or with) the 'Is not visible'

    Your problem occurs because first:

    -Your sprite is visible, so the game unpause and make the sprite invisible

    -Then in the same tick, since it just became invisible, the game pauses and makes the sprite visible

    The Else condition will correct that

  • So the Else statement didn't work either. I'm sure I just messed it up.

    I went with 1-timescale bit. Very simple and gets the job done. Thanks all.

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