AI Perception - more sight sources on one actor

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?

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 :slight_smile:
Elias

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.

Interfaces are almost like components :slight_smile:
No need to write your own stuff if it is already programmed :slight_smile:
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!

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.

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.

Hi PasteDog!

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

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?