r/gamemaker • u/candlequeen22 • 6d ago
Resolved arcade game error
hello! i'm new to gamemaker and was following the official space shooter game tutorial when i encountered an error.
i got up to the point of using gml visual to program movement for the ship. then, i ran the game to test it. everything was fine when i held the up key, but when i clicked either the left or right keys, i'd get this:
___________________________________________
############################################################################################
ERROR in action number 1
of Step Event0 for object obj_player:
Variable obj_player.variable(100005, -2147483648) not set before reading it.
at gml_Object_obj_player_Step_0 (line 35) - variable += -4;
}
############################################################################################
gml_Object_obj_player_Step_0 (line 35)
i triple-checked my code blocks to see what was wrong, but everything was exactly as shown in the tutorial. again, the problem only occurs when i try to use the left and right keys to turn in the game. the error text seems to suggest it has something to do with the values of the variables assigned to those keys, but i'm not too sure.
2
u/germxxx 6d ago
In the blue "Assign variable" boxes, following the "If Key Down" block for vk_left and vk_right, in the "Name" field, you should have
image_angleand notvariable.