"Customizing" the pawn sensing component

Hello! It's been a month since the last post! I was very busy but I was finally able to find some time for the project.

I got stuck on a small detail with my Poison Drone detection logic: I can't just turn the head of the drone and make the pawn sensing component face the same direction as the head.

This is the drone facing forward, as you can see the sensing component also faces forward:

Pawn detection

But if I just turn my head the pawn sensing component still faces forward:

Pawn detection

The "pawn sensing" component cannot be attached to an internal blueprint element so after researching many solutions, I decided to build something a bit complicated... but it works.

I attached a mesh I called a vision cone to the head, it has a special material that looks like wire mesh for testing purposes. If the player collides with this mesh and is still inside, the poison drone could see it:

Vision cone - banner

Then I use the pawn detection component to find out if the poison drone can see the player directly or not since there might be something between them. To achieve this, I set this component to have a 180 degree peripheral viewing angle.

Pawn detection - configuration

Then, in the blueprints, I made some new logic to know if the player is in range of the pawn sensing component and within the cone of vision, if both of these statements are true then they can follow it. Now I can rotate the head and it will only see the player if they are looking at it:

Vision Cone

This needs more work, but for now I'll stop developing this enemy to make a more complex test arcade and work with some interactive elements on the stage like buttons and doors.