Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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?

Product Version: UE 4.8 Preview
more ▼

asked May 17 '15 at 12:31 AM in Blueprint Scripting

avatar image

25 3 8 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

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 :D

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



more ▼

answered May 25 '15 at 12:55 PM

avatar image

MieszkoZ STAFF
7.4k 225 57 414

avatar image unrealChris May 25 '15 at 06:11 PM

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.

avatar image Tessera Studios Nov 30 '17 at 01:05 PM

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

Thanks a lot!

avatar image Jin_VE Dec 06 '17 at 12:21 PM

Another old question that should be closed out.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered May 17 '15 at 06:39 AM

avatar image

2.2k 83 37 121

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

alt text


capture.jpg (26.7 kB)
more ▼

answered May 17 '15 at 01:37 AM

avatar image

1.7k 75 38 110

avatar image unrealChris May 17 '15 at 02:22 AM

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

avatar image unrealChris May 17 '15 at 02:23 AM

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.

avatar image Narghile May 17 '15 at 02:36 AM

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.

alt text

capture.jpg (40.2 kB)
avatar image Narghile May 17 '15 at 02:44 AM

You might be right on further investigation.


(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question