I've been wanting to add AI/NPC to my project for a while and finally figured out a solution that works for me! I wanted to share here my knowledge and how Lyra handles AI spawning and pawn data in general.
This is a part 1 or 3, I'm planning on covering creating an NPC only team in the next one then how to spawn lyra character with abilities that don't have a PlayerState in the next. Game on!
Part 2 at : [ Ссылка ]
Part 3 at : [ Ссылка ]
Github code at : [ Ссылка ]
Project used: Lyra Sample project 5.2
Engine used : Unreal Engine 5.2
Shoutout to this amazing video to help me figure out my audio settings : [ Ссылка ]
Join my Patreon to get video credits and if you'd like to give thanks!
[ Ссылка ]
Thanks for watching!
---------------
Timestamps:
00:00 - Intro
02:09 - How spawning AI works in Lyra
10:33 - C++ for spawning AI : Spawner and logic to get the Pawn Data
18:42 - Setup the spawner and data in BP and DataAssets
33:09 - Outro, closing thoughts
![](https://i.ytimg.com/vi/lzrZJpSqL2U/maxresdefault.jpg)