A 2D cone?
You need to find the angle one point is at (the player) relative to another point (the small end of the cone) and then detrmine if it is between angles (lookdirection-conefov/2) and (lookdirection+conefov/2).
I'm sure there's code in the code archives to find the angle of one point relative to the other. I think it involves Atan or Atan2.
You need to find the angle one point is at (the player) relative to another point (the small end of the cone) and then detrmine if it is between angles (lookdirection-conefov/2) and (lookdirection+conefov/2).
I'm sure there's code in the code archives to find the angle of one point relative to the other. I think it involves Atan or Atan2.