x

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"

Is there a way to set a different trace channel for pawn sensing sight?

Hello, i'm using pawn sensing component so that the enemies follow the player when they see him. If they can't see it they go into search mode. The problem is that if i have multiple enemies following the player, the ones that are closest to the player block the visibility for the the ones in the back so they go into search mode, is there a way to set our own custom trace channel for the pawn sensing to use or define a list of pawn types to ignore? I've looked at the source code and i don't think it's possible as is, if that's the case what can do to avoid that besides creating my own pawn sensing logic?

Product Version: UE 4.14
Tags:
more ▼

asked Dec 20 '16 at 10:07 AM in Using UE4

avatar image

xlar8or
6k 163 129 305

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

2 answers: sort voted first

I ended up doing my own pawn sensing and it's working :)

more ▼

answered Dec 20 '16 at 11:08 AM

avatar image

xlar8or
6k 163 129 305

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

//Edit: Better Solution below

There are multiple possible solutions, but I'd go with the following:

  1. Create an interface called BPI_Player or BPI_Target

  2. Add a MultiSphereTrace to each AI actor searching for pawns. Starting and End point should be the location of the AI actor. If the trace does not work, add 0.1 to the z element on the End vector, although that bug should've been fixed by now..

  3. Loop though each hit result and test if the hit actor implements the interface from step 1. If he does you have a valid target and can use the hit location vector as target position.

This is the same solution I use on my player character to search for visible targets. Keep in mind however that you need to run this algorithm on some kind of tick. You can either use a timer, or move the logic into a component and reduce the ticking rate (0.1 or 0.2 seconds should be enough)

//Edit

This is probably the better Solution: Or the other solution could call GetPlayerController()-> GetControlledPawn() -> GetActorLocation(). This is probably better since it doesn't involve a trace, however you'd still need to run it periodically though.

more ▼

answered Dec 20 '16 at 10:20 AM

avatar image

Ruhrpottpatiot
18 2 5 7

(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