Dr_Nomz
Member
I'm trying to make a zombie attack a barricade based on where it is, since just setting it to attack obj_Barricade.x/y just sends it in random directions. (Because there's more than one)
I want to make 4 different statements changing the variable based on which direction the barricade is relative to the zombie, like if it's to the right of it, it'll attack RIGHT, and it's above it, it'll attack UP.
But how do I write that in GML?
Code:
if (distance_to_object(obj_Barricade_1) < 50){
var angle1 = point_direction(x,y,obj_Barricade_1.x,obj_Barricade_1.y);
}
But how do I write that in GML?