I created an object with two events.
create event -
var i;
for (i=0; i < room_width + 1; i+=1){
xx[i] = i;
}
for (i=0; i < room_width + 1; i+=1){
yy[i] = (sin(i)+sin(i*4))+room_height;
}
draw event -
var i;
for(i=0;i < room_width; i+=1){
draw_line(x.xx[i],y.yy[i],x.xx[i+1],y.yy[i+1]);
}
Error -
action number 1 of Draw Event for object Gen:
Unable to find any instance for object index '128' name '' at gml_Object_Gen_DrawEvent_1 (line 4) - draw_line(x.xx[i],y.yy[i],x.xx[i+1],y.yy[i+1]);
you created 2 arrays of values inside the object,
xx
andyy
. But in draw event you are looking forx.xx
andy.yy
, which means you are looking for arrayxx
inside objectx
, and arrayyy
inside objecty
. Error message says you didnt find these objects. When using dot, part before the dot is object you are looking for, and part after the dot is which value you are seeking. Like this:object.value
.