L
lolurban1
Guest
I'm trying to make an indie game, and I can't use firing delay, can you guys please help me:
x = oPlayer.x;
y = oPlayer.y+10;
image_angle = point_direction(x,y,mouse_x,mouse_y);
firingdelay = firingdelay - 1;
recoil = max(0,recoil - 1);
if (mouse_check_button(mb_left)) && (firingdelay < 0)
{
recoil = 4;
firingdelay = 5;
with (instance_create_layer(x,y,"Bullets",oBullet))
{
speed = 25;
direction = other.image_angle;
image_angle = direction;
}
}
----------------------------------
It gives me this error when I run it:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event1
for object oGun:
Variable oGun.firingdelay(100011, -2147483648) not set before reading it.
at gml_Object_oGun_Step_1 (line 6) - firingdelay = firingdelay - 1;
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_oGun_Step_1 (line 6)
View attachment 23973 View attachment 23974 View attachment 23975
x = oPlayer.x;
y = oPlayer.y+10;
image_angle = point_direction(x,y,mouse_x,mouse_y);
firingdelay = firingdelay - 1;
recoil = max(0,recoil - 1);
if (mouse_check_button(mb_left)) && (firingdelay < 0)
{
recoil = 4;
firingdelay = 5;
with (instance_create_layer(x,y,"Bullets",oBullet))
{
speed = 25;
direction = other.image_angle;
image_angle = direction;
}
}
----------------------------------
It gives me this error when I run it:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event1
for object oGun:
Variable oGun.firingdelay(100011, -2147483648) not set before reading it.
at gml_Object_oGun_Step_1 (line 6) - firingdelay = firingdelay - 1;
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_oGun_Step_1 (line 6)
View attachment 23973 View attachment 23974 View attachment 23975
Last edited by a moderator: