# AI Perception - more sight sources on one actor

**URL:** <https://forums.unrealengine.com/t/ai-perception-more-sight-sources-on-one-actor/378587>\
**Category:** AI\
**Tags:** Perception, unreal-engine, CPP, question\
**Created:** [December 7, 2016, 11:26am UTC](https://forums.unrealengine.com/t/ai-perception-more-sight-sources-on-one-actor/378587 "2016-12-07T11:26:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_8977fd73](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8977fd73](https://forums.unrealengine.com/u/anonymous_user_8977fd73)\
**Post date:** [December 7, 2016, 11:26am UTC](https://forums.unrealengine.com/t/ai-perception-more-sight-sources-on-one-actor/378587/1 "2016-12-07T11:26:37Z")

</div>

How can I add more AI Perception sources for sight sense for one actor? I’ve faced the problem, that actor’s pivot hides underground, so enemies don’t see him. I would also like to have more then only one sense source on the other parts of my character, so that it would be more easy to see the character when “hiding”. Of course I would like all those sources to be treated as they belong to one actor not as seperate ones. Can I do that somehow? Maybe attaching sense sources to sockets?

---

<div class="post-metadata">

**Author:** ![PasteDog](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PasteDog](https://forums.unrealengine.com/u/PasteDog)\
**Post date:** [December 12, 2016, 10:33am UTC](https://forums.unrealengine.com/t/ai-perception-more-sight-sources-on-one-actor/378587/2 "2016-12-12T10:33:04Z")

</div>

Hey Krzysiek\_TATE,

To be able to do this you’ll have to, implement the `IAISightTargetInterface` on your character and override the `virtual bool CanBeSeenFrom(const FVector& ObserverLocation, FVector& OutSeenLocation, int32& NumberOfLoSChecksPerformed, float& OutSightStrength, const AActor* IgnoreActor = NULL)` function.

And in here you can make extra traces for vision.

Hope this is helpful to you 🙂  
Elias

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8977fd73](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8977fd73](https://forums.unrealengine.com/u/anonymous_user_8977fd73)\
**Post date:** [December 12, 2016, 4:12pm UTC](https://forums.unrealengine.com/t/ai-perception-more-sight-sources-on-one-actor/378587/3 "2016-12-12T16:12:09Z")

</div>

Hey PasteDog, Thanks for replay. I’ve found that too a couple of hours after writing this question. I was hoping to get some more clear solution, like attaching some component that will give me and option to add additional points or something. I’ll probably do something similar on my own then.

---

<div class="post-metadata">

**Author:** ![PasteDog](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PasteDog](https://forums.unrealengine.com/u/PasteDog)\
**Post date:** [December 12, 2016, 5:36pm UTC](https://forums.unrealengine.com/t/ai-perception-more-sight-sources-on-one-actor/378587/4 "2016-12-12T17:36:40Z")

</div>

Interfaces are almost like components 🙂  
No need to write your own stuff if it is already programmed 🙂  
in your .h file:

```
class MYGAME_API AMyCharacter : public ACharacter, public IAISightTargetInterface
{
GENERATED_BODY()
...
public:
virtual bool CanBeSeenFrom(const FVector& ObserverLocation, FVector& OutSeenLocation, int32& NumberOfLoSChecksPerformed, float& OutSightStrength, const AActor* IgnoreActor = NULL) const override;
...
}

```

And then just fill in whatever you need in the function.

Good luck!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8977fd73](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8977fd73](https://forums.unrealengine.com/u/anonymous_user_8977fd73)\
**Post date:** [December 13, 2016, 11:06am UTC](https://forums.unrealengine.com/t/ai-perception-more-sight-sources-on-one-actor/378587/5 "2016-12-13T11:06:50Z")

</div>

As I said, I know that interface. I’m already using it. Maybe I wasn’t clear on that. I was thinking about some more visual way on that. To give designers an option to put some points on their own on the model itself.

---

<div class="post-metadata">

**Author:** ![PasteDog](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PasteDog](https://forums.unrealengine.com/u/PasteDog)\
**Post date:** [December 13, 2016, 4:58pm UTC](https://forums.unrealengine.com/t/ai-perception-more-sight-sources-on-one-actor/378587/6 "2016-12-13T16:58:50Z")

</div>

In here you can check for sockets on the skeletal mesh for example, and expose the socket-name list to the designer, then they can add sockets wherever they want.

---

<div class="post-metadata">

**Author:** ![rit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rit](https://forums.unrealengine.com/u/rit)\
**Post date:** [April 27, 2017, 2:56pm UTC](https://forums.unrealengine.com/t/ai-perception-more-sight-sources-on-one-actor/378587/7 "2017-04-27T14:56:25Z")

</div>

Hi PasteDog!

Do you happen to know anyway to achieve the same result using blueprint?

---

<div class="post-metadata">

**Author:** ![LDOGLONDON](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LDOGLONDON](https://forums.unrealengine.com/u/LDOGLONDON)\
**Post date:** [July 24, 2018, 9:47pm UTC](https://forums.unrealengine.com/t/ai-perception-more-sight-sources-on-one-actor/378587/8 "2018-07-24T21:47:52Z")

</div>

So by adding that interface you can override what the perception component is using for its checks? Also have you found a designer friendly way of implementing this? Like if they bring in a model and you want to be able to define the perception points and the angles that each point uses?
