How to attach the "pawn sensing" component to a bone?

Hi,
I’m looking for a way to attach the pawn sensing component from a pawn to a bone. Like for exemple to have the pawn sensing cone following the head.
So far, I wasn’t able to move the pawn sensing component in my viewport, nor being able to attach to anything.

I’m trying to do the same thing, can anyone help?

I would like this too

Hi everyone,

I just tested this in 4.10.2 and the Pawn Sensing component comes in located at the head of the character. If you aren’t seeing this behavior in this version, please post back to let me know and provide screenshots showing the issue.

To answer the original question, no, the Pawn Sensing component can’t be attached to a bone through blueprints. If you need to alter the location, it will need to be changed though code.

Cheers,

TJ

Okay, that works for now, by what if I want an AI to turn it’s head to look rather that turning the character?
Would I have to rotate the character then rotate the mesh the opposite way so you don’t see it moving all while doing the animation?

Thank you @TJ, I’m still using version 4.9, today I’ll check if passing to 4.10 does’t mess up my project and tell you.

@Hobgoblin101: I think in your case you could just move your charachter’s head bone trough an animation or a blueprint script.

The Pawn Sensing component is not a ‘scene component’ so it technically doesn’t exist like other components (Ex. Skeletal Mesh, Camera, etc). It isn’t locked to the head bone but it has just been adjusted to be placed at the heads approximate location on a standard character. Once again, to change this behavior, it would need to be implemented through code.

Does anyone know how this is done in code ?

Alternatively i guess the only other option is to also have a line trace from a socket in the head, while the character is turning the head and looking around.

Hi Eddie,

I spoke with our AI system expert on this.

Basically, the PawnSensingComponent is a simple and convenient way for many people to get up and running. However, it’s not possible to attach it to a bone and have it work as you are expecting. It would still use head location as the sensing location.

Instead we suggest using the AI perception system. We don’t currently have extensive documentation on this but you can find other users on the Forums and AnswerHub that are discussing it’s setup.

i’m checking it out now, and have some questions, but first i’ll try to dig it deeper.
Anyway, thanks a lot for the helps!

Would I be correct it saying that the sight component of it is just a overlap cone effectively? Probably doing a check to see how lit the object is to see if it is actually possible to see it?
So I guess if I was the pawn sight component to be attached to the head for rotations, then I should / could make my own.

Probably the basic idea is this, but I assume there are some optimizations and stuffs, because checking collisions every tick may be overburdening if there are lot of pawns oding it.

I have tried modifying the code with blueprint, but it wont let me input the pawn sensing compnent into the get position. I assume this is because a mesh needs to be attached, but I dont know how to attach it. every time I try to add a component to it, it adds it to the player itself.