To make the Poison Drone sentinel that chases the player, I first created a blueprint where I added some parts of the asset pack that I bought, this asset pack has interesting parts and materials and it allows me to create different drone prototypes for my game.
I already showed part of this design in the previous post, now it's something like this. I'm not interested in evolving this design further for now, since it's enough for me to be a prototype:
The red eye will glow in the dark, I intend to help the player locate the Poison Drone while also making it unsettling.
Then, to indicate to the AI where it can circulate, I have added a NavMeshBoundsVolume to the stage:
The AI to chase the player will activate when the sentinel sees it within its vision radius or hears it, for this I have added a "Pawn Sensing" component that gives me the necessary events to control this:
In the Event Graph of the blueprint I have added the logic with the "AI Move To" node:
I have created a new "Follow Player" event to be able to separate the logic of chasing, patrolling, searching, etc. For now only the Follow Player event is activated but in the future I will need to apply different behaviors that will be activated with new events in certain circumstances.
I'll finish developing it later.
For now the result obtained is interesting but the drone turns abruptly:
To make the movement smoother I have modified two parameters:
- With the main element of the blueprint selected I have gone to the Pawn details section and unchecked the "Use Controller Rotation Yaw" option.
- With the Character Movement component selected I went to the Character Movement details section (Rotation Settings) and activated the "Orient Rotation to Movement" option.
The result has been satisfactory:
I'll leave it here for now but I'll continue to work on this sentinel's AI from this point on but for now I have:
- A prototype that waits quietly until it sees the player.
- When it can see the player, it chases them until they are touched.
- It can chase the player around the stage avoiding obstacles.