Object facing problem...

Is it possible to detect whether an object is facing towards another object?

Here is a simple example:
FacingTest.zip (7.83 KB)
In the first method, the easiest one, I just use a “vision cone” sprite to detect if it collides with the target.
In the second method a mathematic aproach is used, checking angles of view and positions.
De/activate the groups to check that both methods work correctly :slight_smile:

The limitation is that none of the methods checks if there is an obstacle between the eye and the target, a third method would be using “ray-casting” as the laser and zombies example does…