0 Favourites

Pausing & "Else" Condition Problem

  • Hello hello. So I'm trying to create a pause function. I figured it'd be as easy as:

    +Keyboard: On spacebar pressed

    +player.state = "idle"

          +Pause = 0

                -> Call Function "Pause"

          +Else

                -> Call Function "Unpause"

    However, when I try to pause in game, nothing happens. I take away the "Else" segment, and then it pauses just fine, but leaves me unable to unpause. I think what's happening is the game checks to see if Pause = 0, then runs the "Pause" function, and then immediately after it checks to see if Pause =/= 0, and then runs the "Unpause", all before the next frame is drawn so it appears as if nothing happened. Both functions work fine on their own when triggered, it's only when I try to use an "Else" type deal.

    Also tried:

    +Keyboard: On spacebar pressed

    +player.state = "idle"

          +Pause = 0

                -> Call Function "Pause"

          +Else

          +Pause = 1

                -> Call Function "Unpause"

    +Pause = 0

          +Keyboard: On spacebar pressed

                -> Call Function "Pause"

    +Else

          +Keyboard: On spacebar pressed

                -> Call Function "Unpause"

    ... and other variants of the above with the same result of nothing appearing to happen.

    I thought "Else" was designed to run the event if the previous event didn't run, but that doesn't seem to be the case here. Is this a bug or am I just doing it wrong?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
1,068 148,700
Reflextions's avatar
Reflextions
Unread hot topic
604 153,304
aniketraorane's avatar
aniketraorane
Unread hot topic
256 37,737
tutbarao's avatar
tutbarao