- Get the Player spine_02 location.
- Get the Ai Hand_R location.
- subtract the Hand_R location from the spine_02 location.
- Normalize
- Get the Dot product between the AI forward vector and the normalized.
- convert the radians from the above to angles.
Is the above method more efficient than the FindLookAtRotation?
Getting the dot product of 2 vectors and then calculating the result’s acos (degrees) is used when trying to find out the angle between 2 vectors. If you’re trying to get the angle between 2 locations, you should use the Find Look at Rotation
node. Plus, the acos function never returns a negative value so you’d only be getting the absolute value of the angle unless you add an extra step.
Interesting approach! Using the dot product with normalization for angle calculations can indeed be efficient, especially for simple pitch checks. While FindLookAtRotation is straightforward, it can add overhead if you’re just looking to get a quick angle between two points. Normalizing and using the dot product gives you more control over calculations and can be a bit faster, especially if you’re optimizing for performance in something like an enemy AI tracking system. Have you tried profiling both methods to see if there’s a noticeable difference in runtime?