Dot product not working as intended

In the image below you can see my setup for getting the dot product of two actors. The problem is that “get dot product to” only gives a different value depending on my position and the output is way higher than 1. I also tried it with the dot product node and it does work better. It gives me a value between -1 and 1 and changes values when I look elsewhere but it still doesn’t fully work. The value only changes by 0.1 when i make a 180 degree turn and it seems like the output still depends mostly on where I am standing and not where I am looking. Can somebody please tell me what I am doing wrong?

You’re getting the world location which is not dependent on your orientation.

If you want to process something related to where you are looking, try GetForwardVector from the camera ( and the other mesh ).

( unless you’re looking for the angle between these actors with respect to the origin… )

And what about “get dot product to”? Why isn’t that working?

I’ve never used that node, but it must also be looking at the angle made between these actors and the origin because it has no other information.

Also, I think you may be confusing the GetDorProductTo node, the default top pin is ‘this’ actor ( which also means it doesn’t need any input ), but you’ve fed that into the bottom pin.

1 Like

Can you say what you’re trying to do, maybe I can help.

Are you trying to find the difference in rotation between two actors?

I am trying to find out if the player is looking at an object which I have called best interactable.

That did the trick. Thank you very much. Would you mind writing an answer instead of a reply so I can mark it as the answer?