AI Perception only can detect middle of player

I have a player character peeking out of cover with his head sticking out. However, the AI with AI Perception can’t see him because the middle of his body is not visible. Is there anyway to make the AI be able to detect his entire body?

Hi Mate,

Just checked with my Perception, made a wall that only head shows, and he shoots my head.

Might be a 4.8 thing.

43023-capture.jpg

Narg

does he always shoot your head though?
Or does he shoot whatever part of your body he sees?
Thanks for response mate.

I also realized it has to do with the pivot transform, it detects wherever the pivot transform is and i dnt know how to move that.

Well, I suppose I do not have a head. LOL,

But if I move out, past the glass I get shot. But hard to tell what he can see though.

Would have to remove damage and explosion, and show line trace to double check.

43024-capture.jpg

You might be right on further investigation.

Narg

I’m pretty sure AIPerception’s sight sense just uses a trace to the actor location and ignores the actor’s geometry. Doing anything more detailed would be considerably more expensive performance-wise and also hard to generalize, given that perception should work with any kind of actor.

That said, it would certainly be possible to add a sight sense which had a special case for, for example, actors with a USkeletalMeshComponent, which did multiple line traces. The system is set up so you can register your own custom sense classes. I think it’s probable support will be added by Epic for this at some point in the future too.

To make AI sight sense use custom locations for testing character’s visibility make your character class derive from IAISightTargetInterface and override CanBeSeenFrom. You can test whichever points you want inside :smiley:

We’ll introduce blueprint-friendly way of doing that at some point.

Cheers,

–mieszko

Thank you Mieszko,
The way I did it in blueprints:
I attached a trigger box to my character’s head and called Register Perception Stimuli Source on the trigger.

Having the same problem here, UnrealChris. Could you be a little bit more specific on how to override the function “CanBeSeenFrom”?

Thanks a lot!

Another old question that should be closed out.

quote:

To make AI sight sense use custom locations for testing character’s visibility make your character class derive from IAISightTargetInterface and override CanBeSeenFrom. You can test whichever points you want inside :smiley:
We’ll introduce blueprint-friendly way of doing that at some point.

This was 2015. Any progress on this?

@unrealChris
“Register Perception Stimuli Source” only accept actors, and not components. Would be a good and easy idea when we can make new trigger points AI Perception is checking for. But how do you did it when the BP node only accept actors and not components of an actor?