L
Liron
Guest
Hello, I'm new in GM,
I try to create bullet and I have this error:
I try to create bullet and I have this error:
and this is the code: (obj_Gun, Begin Step)___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event1
for object obj_Gun:
Variable obj_Gun.objBullet(100003, -2147483648) not set before reading it.
at gml_Object_obj_Gun_Step_1 (line 10) - with (instance_create_layer(x, y, "Bullets", objBullet))
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_Gun_Step_1 (line 10)
Code:
x = obj_Player.x + 20;
y = obj_Player.y + 13;
image_angle = point_direction(x, y, mouse_x, mouse_y);
firingdelay = firingdelay - 1;
if(mouse_check_button(mb_left)) && (firingdelay < 0)
{
firingdelay = 5;
with (instance_create_layer(x, y, "Bullets", objBullet))
{
speed = 25;
direction = other.image_angle;
image_angle = direction;
}
}
Last edited by a moderator: