Legacy GM [SOLVED] An object checks if another object is in the view

ruwcom

Member
So I have a wall that prevents the player to move forward until there are no enemies on the view, I though the easiest way was to check just that and then destroy itself, but the code needs to run in the wall object, how can I do that? collisions don't seem to work.
Also It can't be !instance_exist because there would be more enemy objects, but outside of the current view.
 

FrostyCat

Member
Code:
if (collision_rectangle(view_xview[0], view_yview[0], view_xview[0]+view_wview[0], view_yview[0]+view_hview[0], obj_enemy, false, false) == noone) {
  instance_destroy();
}
 
Top