Attach Pawn Sensing to Head?

Hello, I’ve been trying to figure out a way so that the pawn sensing is attach to the head socket or the movement of the head. I have a raptor, that occasionally turns its head around, but the pawn sensing remains looking forward.

Here the raptors performs the animation of looking around. The raptor turns the head right, the pawn sensing is still looking forward. This is inaccurate because the player could be standing at the right side of the raptor, but the raptor will not see the player. How can I fix this? Any answer is appreciated. Thank You.

C++ or BP?

If C++ then https://pastebin.com/JBgEni05

If BP then https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1343269-attach-ai-sight-to-pawn-head-perception#post1711087. Create Pawn … attached it to character …

Right I forgot to add, I’m using the default pawn blueprint cause it has the movement character function. I’m guessing there is no way to do this on the default pawn blueprint right?

You mean the character?

Thank you! I’ll try it out as soon as I can!

Correct

Create and setup a socket in neck or head:

First create a pawn X and add a AIPerception component:

Then, in the character, spawn the Pawn X and attach it to the socket:

You must still setup the communication between the sensing Pawn X and the character accoding to your needs (in this case it just print hello when other pawn is detected).

PS: the Visual Debugger doesn’t work for this method.

Thank you, it worked! You’re awesome