Download

How to use UPawnSensingComponent in C++?

Hello all! How would I use UPawnSensingComponent in C++? I’ve looked at the documentation but there’s not much information on how to exactly use it. I would like to get the pawn found, and use it’s data for my behavior tree. Any help? Thanks! :slight_smile:

Inside my own class derived from the UPawnSensingComponent I have implemented my own logic for sensing a pawn.

I use a PawnIterator to iterate over all possible targets. Inside this iterator I do various checkups implemented in the SensingComponent like “CouldSeePawn” and “HasLineOfSight”.

Hopes that helps.