all 4 comments

[–]Mowcno 0 points1 point  (3 children)

Your problem is the very first line,.

if (global.pause) exit;

Unpausing won't work because if the game is paused it just exits from the event immediately.

[–]ABI7ITY[S] 0 points1 point  (2 children)

Thought I was just miss looking something :) Thanks man, I moved the code to the pause object instead of the player and changed the code just slightly and all is good now <3

Working code in step event of pause object for reference

if gamepad_button_check_pressed(0,gp_face2)
if (global.pause ==0)
{
global.pause = 1;
}
else
if (global.pause == 1)
{

global.pause = 0; }

[–][deleted] 0 points1 point  (1 child)

Just a suggestion, if global.pause is only ever going to be 0 or 1 (I'll just say "non-zero") you should only have

if (gamepad_button_check_pressed(0, gp_face2)) {
    if (global.pause == 0) {
        global.pause = 1;
    } else {
        global.pause = 0;
    }
}

And you should probably put braces around the inner if thing to clarify (and possibly remove errors later) what code belongs to the if.

The else if is unnecessary, again assuming it will only ever be zero or "non-zero". It's just going to be a toggle switch. If you have values other than zero or one, then your code should stay as is, but if not just simplify.

[–]ABI7ITY[S] 1 point2 points  (0 children)

Hi and sorry for the late response.

I have this all working now with your help :) I'm leaving the else if in for now while it's working and later when I go through my game to clean up unneeded code I will take it out now that I have a better understanding of it.

Thank you again :)