XaiJu
CodeLikeMe
CodeLikeMe

patreon


Unreal Engine Custom Sight Perception Target- Head

This is the 23rd episode of the unreal engine advanced locomotion series. But still, you can apply this method to change the point of the character seen by AI sight perception system. By default, AI sight of enemies can see the middle of the character. Because of that, when the player is behind a short wall, even if the character head can be visually seen over the wall, AI characters can't detect the head because the line of sight to the middle of the character is blocked. So, what we have to do is, change the point of the character checked for sight perception line of sight to head socket.  In order to do this, we would need to do some modifications in C++. But even if you are not familiar with C++, this would be very few simple steps to follow.  In unreal engine, The AI sight is implemented through a virtual function called CanBeSeenFrom implemented through IAISightTargetInterface. We will create a child class of internal Character(CLM_Character) class and override this particular function to use the head socket and the blueprint character class we have in the editor will be re-parented to the CLM_Character class we created to have the overridden behavior. I will explain how to do this in detail in this video.

Advanced locomotion system: https://www.unrealengine.com/marketplace/en-US/product/advanced-locomotion-system-v1

CodeLikeMe Third-Person shooter series: https://www.youtube.com/playlist?list=PLKLABJGyKV-CmWAXXeuUTer0iI0kSG1W4

.

project files

https://www.patreon.com/posts/63654325

Unreal Engine Custom Sight Perception Target- Head

More Creators