if image_xscale = 1 {
var i;
for (i=0; i<=40; i+=1) {
if place_meeting(x+i,y,obj_hitable) {
instance_create(x+i,y,obj_impact)
with instance_position(x+i,y,obj_hitable) {
event_user(0);
}
break;
}
}
}
if image_xscale = -1 {
var i;
for (i=0; i<=40; i+=1)
if place_meeting(x-40,y,obj_hitable) {
instance_create(x-40,y,obj_impact)
with instance_position(x-40,y,obj_hitable) {
event_user(0);
}
exit;
}
}I was trying to do a sort of hitscan thingie where it starts out from obj_player.x and loops until i hits 40, that way you don't have to hit the enemy right on to do damage... but this way I don't hit him at all. Any thoughts?



Find content
Male







