I was playing around again with Construct 2 and was wondering whether or not i can check if the cursor is between 2 specific angles of an object. For example the mouse being between 70 and 110 degrees of a player or it being -20 en 20 degrees etc.
Thanks in advance
Develop games in your browser. Powerful, performant & highly capable.
Yes you can, What I did was set up a sprite set it's angle towards my mouse X and Y. Then I used the "is between angles" of that sprite to find what angle my mouse is at on the screen.
Thanks! I was thinking about this but did not test this yet. Thanks a lot!
You can use the expression:
to get the angle between the object and the mouse
So something like this should work:
system is between angles : angle(object.x,object.y,mouse.x,mouse.y) ; object.angle-20 ; object.angle+20