A
AtLantiSs
Guest
Guys I'm using this code
what it does is that it checks if the player is hiding behind a wall. If it is, then an alarm sets off, when the alarm is running, then the enemy no longer sees the player and walks off to its gaurding point.
Problem is, I can just walk up to a wall and just move my player very close to the wall, then the enemy acts like I'm hiding and the script runs and the enemy doesnt see me when I'm right in front of them!
Screenshots
Enemy sees me in this pic:
Bellow the enemy is right in front of me but the collision line isn't doing its job... (I already checked masks and collision masks, thats not the case)
Code:
///Check if it can see
if see = 1
{
if blocked = 0
{
if collision_line(x,y,target.x,target.y,obj_wall_basic,0,0)
{
blocked = 1;
soundoff = choose(0,1);
alarm[10] = room_speed*2;
}
}
}
if !collision_line(x,y,target.x,target.y,obj_wall_basic,0,0)
{
blocked = 0;
}
Problem is, I can just walk up to a wall and just move my player very close to the wall, then the enemy acts like I'm hiding and the script runs and the enemy doesnt see me when I'm right in front of them!
Screenshots
Enemy sees me in this pic:
Bellow the enemy is right in front of me but the collision line isn't doing its job... (I already checked masks and collision masks, thats not the case)