I'm trying to draw a target to signify that my character is locked onto an enemy, but I get an error that says.
A step event that has this,:
And a draw end event that has:
Apparently the error comes in at
The code for drawing the event has a create event that has this code,:Trying to draw non-existing sprite.
at gml_Object_objhominglock_Draw_73 (line 4) - draw_self()
draw = false;
radius = 75;
image_speed = 0.35;
A step event that has this,:
if radius > 15
radius -= 6
else
draw = true
if Sonic.action == -5
instance_destroy()
x = instance_nearest(x,y,objhomingtarget).x
y = instance_nearest(x,y,objhomingtarget).y
And a draw end event that has:
if draw
draw_self()
else
{
draw_set_circle_precision(32)
draw_set_colour(c_lime)
for(i = 0; i < 2; i+=0.1)
draw_circle(x,y,radius-i,true)
}
Apparently the error comes in at
draw_self()
. Why is this and what can I do to fix it?