Download

Comparing the joystick direction using trigonometry, but what's the best way?

Let’s say I want to know if the Yaw of an actor is within 125° to the right of the joystick rotation; basically I ‘‘get control rotation’’ so I get a range between -180° and 180° for my Joystick Yaw and I compare it with my actor’s Yaw. But comparing gets weird when the actor’s Yaw gets too close to 180°, let me explain, if the joystick Yaw is 160°, it means the range is 161° ro -95°. I’m skeptical it’s the best route because I have to make 2 comparisons, if Actor Yaw = >161° and <180° or Actor Yaw = >-95° and <-180°.

What do you guys think? I have it working, but my intuition tells me I’m complicating things.

<

what are you trying to do precisely?

Yeah I’m having difficulty explaining, sorry.

I’m trying to turn on a boolean when the joystick is pointing within a range of directions. This is what the scheme in the first post represents.