Solving for Angle

Hello!

I have a flying vehicle with 4 Blasters, 2 on each wing. I have an option for Quad, Dual and Single fire. What I want to do is create a function that runs before each blaster bolt is spawned that adjusts the angle of each blaster to point at the target distance.

I have a line trace with a maximum distance of 5 kilometers (ADJACENT). I know the distance of the blaster to the camera. (Opposite)

With those two measurements I can get the HYPOTENUSE and from there I can calculate angle A.

Iā€™m just wondering if UE has a function that handles this.

I believe the node you are looking for is Find Look at Rotation . The goal is to just make the blasters on top face the target for the visuals, right?

1 Like

Yup, Find look at rotation will return the correct ROT.

A: Missile/Blast Spawn/start location (muzzle)
B: End location (Target)

Find look at rotation (A, B)

Thanks, that seems to have been the answer.