I am making a GameMaker game that involves the enemies having line of sight so that they don't target the player through a wall. I have this code that uses collision line to detect whether there is a wall between the enemy and the player, then sets
CanSee to 1 if true.
if collision_line(x, y, obj_parent.x, obj_parent.y, obj_wall_parent, false, true) global.CanSee = 1;
However, this code does not ever affect the value of
CanSee. Am I using this code wrong?
Here is my room setup. The walls all have
obj_wall_parentas their parent.
Here are some of the objects: