I'm making a top-down space shooter enemy AI. The enemy ship can rotate in any direction. I want to be able to test whether a certain object is within a range of angles relative to the rotation of the ship.
For example if an obstacle is within 0 to 30 degrees (of the front of the ship) I can make the ship turn left (to avoid it) and if there's an obstacle within 0 to -30 degrees I can make the ship turn right.
Using the Angle expression doesn't work because it doesn't account for the rotation of the ship.
And the AngleDiff expression doesn't work because it provides an absolute value and I can't tell whether the object is to the left or right of the ship.
Here's a simple capx that I hope will demonstrate what I'm trying to accomplish.
Thanks for the help!