# [SOLVED] Limiting Missile Fire by Angles

Hello All. I’m trying to get the angle between the direction my Hover Tank is facing and where the locked target is actually at. At launch, the weapon “turret” faces the same direction as my Hover Tank So, by my thinking, I’d like the forward vector of my “turret” to define the direction my missile is facing. It will launch in that direction. I’d like to know what angle, off the nose of my turret, the locked target is at.

Here are my assumptions:
Directly to my right = 90deg
Directly to my left = 270deg (or is it -90deg?)
Directly in front of me = 0deg and
Directly behind me = 180deg (or is that -180deg?)

How do I calculate the angle so I know how many degrees to the left or right of my turret the locked target is at? I will set the missile to lose lock if the target is more than 70deg off my nose - either left or right. That’s either >70deg OR <-70deg or it is >70deg OR -290deg off my nose. I’ve been trying “Find Look at Rotation” and using a “Dot Product” node with no success so far. I just don’t understand the math in 3D space…

Currently, the missile will fire backwards if the locked target is directly behind me. This is the kind of behavior I’m trying to correct. I’d only like the missile to engage in a somewhat realistic manner since it can’t just flip around at launch, you know?

Thank you - any and all help is appreciated!

OK, I watched this video and it has the solution starting at about 14mins:

And here it is worked out in my Blueprint. I use the “Find Look At Rotation”, then make a “Delta Rotation” based on the world rotation of the Hover Tank and the Look At Rotation. I split the Delta Rotation results (only need the Yaw) and make the Yaw an “Absolute” (I don’t care if the angle is positive or negative) and if it is less than 75deg, it locks on to the target. That is done using a “Branch” node that is off-screen. If it is greater than 75deg, it launches the same missile without the lock - straight forward.