To begin the NPC implementation within my work, I needed to first source another set of animations, as my NPC was planned to be humanoid, yet an alien of some sort.
I sourced a character mesh and animation set and imported them directly into a new folder within my file structure, followed by the creation of a blendspace as I did with my main character.
With this set up, I created an animation blueprint tied to the NPC's character blueprint and placed a NavMesh Bounds Volume ready to be utilised by the AI in engine.
To make the NPC track the character, a pair of different pawn sensing setups were implemented.
The first was set up by adding a pawn sensing component into the NPC character blueprint itself, which allowed me to set a field of view within which the NPC would be able to trace my character.
With the cone set appropriately, the blueprinting was set up fairly simply using an "AI MoveTo" node, linked into a few component references and a 'get player character' node.
The second iteration of the AI moveTo setup was configured slightly differently, in the sense that when the AI could not see the player, it would fire off a node to a custom event called Find Player, this would set the rotation to face the player character and the AI would then begin its approach again toward the player.
Below is a screen grab of both of a portion of both pawn sensing setups, the first not being currently in use, has been disconnected;

No comments:
Post a Comment