I have been following the tutorial videos on game maker, and I am at the part where he explains how to get the bullet under the character. I thought I did everything right. He then tested the game, and it worked. But when I played, and tried to shoot, this message appeared:


FATAL ERROR in action number 1 of Step Event0 for object obj_player:

Variable obj_player.layer_bullet(100002, -2147483648) not set before reading it. at gml_Object_obj_player_Step_0 (line 30) - instance_create_layer(x, y, layer_bullet, obj_bullet);

  • \$\begingroup\$ Have you created a layer with name layer_bullet in room or using layer_create() function? \$\endgroup\$
    – Dmi7ry
    Sep 10, 2017 at 6:06

1 Answer 1


Layers have to be referenced via their name, provided as a string. Try changing your create function in the step event to

instance_create_layer(x, y, "layer_bullet", obj_bullet

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .