Advanced Spawn System

Animal AI



Create BP Character, name BP_Pig
Replace the mesh to the animal wanted, rotate 90 degree that fit the arrow direction
image.png
To event graph
P.S.
acceptance radius (120) = how close want AI stops when it reaches destination
Radius (500) =how far apart is going to be able to get a location
image.png

Drag the BP and add NavMeshboundvolume in scene
Now the AI works, but no animations and rotate not natural. To improve it:
Disable rotation yaw of animal BP, in the
image.png
in character movement, enable this:
image.png
ss
reduce max walk speed to 380cm/s
image.png

Create animation BP, name ABP_Pig
image.png

Create Blend space 1D, name horziontal axis and add idle, walk, etc
image.png

Back to Anim BP, set below graph and add speed variable, check the anim in preview window, by changing default speed between 0 and 350
image.png
Go to event graph, promote variable from Cast to BP node, name as Pig:
image.png
Continue by drag pig variable, connect to Get Character Movement, Get Velocity variable nodes
image.png

Back to Pig BP, viewport, mesh component
Change anim class
image.png
In its event graph, increase radius from 500 to 2000 in get random reachable point radius, so it won’t stop so frequent
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.