AI Character as Enemy (part1)

Easiest way to make AI enemy



Create BP character called BP_EnemyAI
Add mesh in its BP rotate 90 degree
Add PawnSensing component, change angle to 70, add on see pawn event
image.png
image.png

Drag the enemy BP in scene, add nav mesh volume

Make Anim of Enemy


Create Blendspace 1D anim with enemy mesh skeleton, set:
image.png
add idle, walk and run anim

Create Anim BP, make anim graph
image.png
in event graph
image.png
change BP anim in enemy bp mesh in viewport
image.png

Make Attack of Enemy:


Go to Enemy BP, increase acceptance radius to 70 (let enemy move not too close to character)
image.png
Add Can Attack? boolean and graph as
If enemy see player, starts attack, then attack again when still seeing (first Set attack node should output to branch, not AI move to)
image.png

Add Default slot node in Anim BP (play anim if anim montage is created)
image.png

When enemy not see player (false branch), stop follow player (if he loses track from player)
image.png

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.