Why game does not see the input of the "R" key?

57 Views Asked by At

The game does not see the input of the "R" key, I use a

{
    if keyboard_check_pressed(ord("R")) && global.died = true{
        global.died = false;
            room_restart();
    }
}
1

There are 1 best solutions below

0
YellowAfterlife On

If you are using a current version of GameMaker, the code in a script should be in a function, e.g.

function scrCheckRestart() {
    if keyboard_check_pressed(ord("R")) && global.died = true{
        global.died = false;
            room_restart();
    }
}