Game setting

Advanced Spawn System



Create a BP actor called BP_SpawnPoint
Add box collision component, name as bound
Set no collision
image.png
New function: SpawnCharacter
image.png
Event graph (visible the promoted variable):
image.png

Drag the spawn actor in scene, input spawn amount and test in play
Now is able to spawn the characters they are in random place and float in air
To solve it:
image.png
modify:
image.png
image.png

Let AI for spawn walk around the box area


Duplicate 3rd person BP, rename as BP_EnemyGuard

Back to SpawnPoint BP, extend the graph:
image.png
Create a AI Controller BP, name as AIC_Enemyguard
Create a behavoir tree and blackboard, rename them as BB_EnemyGuard and BT_EnemyGuard
image.png
Open behavior tree, create graph:
image.png
Blackboard, add newkey and name as:
image.png
Back to behavoir tree, change the blackboard key:
image.png
Click New task, name as BTT_SetMoveToLocation:
image.png
In its task graph:
image.png
Back to BP EnemyGuard, add
image.png
In SpawnPoint BP, change the class, and add the following nodes:
image.png
Back to BTT_set move to location graph:
image.png
Back to AIC EnemyGuard graph:
image.png
Add function called Set Move to Location
image.png
Back to BTT set move to location
image.png
Go to behavior tree:
image.png

Add NAV mesh bound volume in scene that cover the scene

Back to SpawnPoint, spawn character graph:
image.png

Not working, spawn still not moving around
16:30

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.