How do I get the player to rotate or face an NPC?

So this here is my character BP for when the player talks to an NPC.
I wanted the player to rotate to face the NPC that the player is trying to talk to. Problem is that I don’t know how to get the location of that NPC.

I’m assuming that I have to find the right nodes for the part I circled in the picture, but I don’t know what nodes I should use, nor how to set it up. Not even sure if I should scrap this whole setup. How can I get the player to look at the NPC?

Your cast node doesnt working.
You must execute overlap event and store reference of npc somewhere.
Then, use node “find look at rotation” put there your and npc location and use thisrotation to rotate to npc.

Your On Component Begin Overlap node isn’t connected to anything.

yep, thats the problem. You need to know which NPC to talk, for this is ideal overlap event, you must execute somewhere overlap… if you dont execute overlap (white wire) then blue wire (other actor) won’t work = cast node not working = get actor location not working.

Ok, so taking into consideration some advice, I revised it, removed the interp to simplify it for now, and now it looks like this. The intent was to have the player have the camera immediately look at the npc:

But still it doesn’t work. when I hit “E” to trigger the custom event, it moves the player slightly backwards (instead of rotating to look at NPC), as seen in this video. Now I’m even more confused:

Also, note that the OnComponentOverlap node is just there for the sake of having something plugged into the object pin of the Cast To node, since the InputAction node doesn’t have the “other actor” pin. Otherwise I don’t know what to connect to the object pin of the Cast To node.

The “On Component Begin Overlap (Capsule Component)” node hasn’t got anything connected to its execution pin so nothing will happen. Drag off from this pin and do the cast there instead.

You mean like this? the same thing still happens. Though the player moves a tiny bit more backwards.

Inside your Player, make a variable that is the same datatype as your NPC called “InteractingAI” or something.

Inside your NPC class, add a sphere collision around the AI, then OnComponentBeginOverlap, cast to player, if the cast is successful, drag off from “As Player” and set InteractingAI to self. Then you can do OnComponentEndOverlap, cast to player, set InteractingAI to nothing.

Then inside your Player class you can Get InteractingAI, right click this node and convert to validated Get at the bottom. This checks that the value isn’t null. Then you can use that InteractingAI anywhere in your class then past this validated get, and you don’t need to do the overlap on the AI.