Hey everyone. I’m following a tutorial from a book called Blueprints Visual Scripting for Unreal Engine 5 (3rd edition) by Packt. I’ve encountered this issue, and I hope someone can help me
I want the enemies to patrol, hear and investigate sound locations, chase and attack the player. More enemies will spawn if there are fewer than five enemies in the level.
However, if I spawn enemies (by using BP_EnemySpawner) or manually drag multiple BP_EnemyCharacter into the level, the enemies won’t move/attack/chase/deal damage. I feel like it’s because the AI controller can’t recognize which one to possess but I don’t know how to solve it.
Can anyone help me with this :))
p/s: please let me know if I need to provide any more information, I’m just starting out and this is my first time
In the enemy pawn blueprint, on the class details try changing the “Auto Posses AI” to “placed in world or spawned” and also add your AI controller class. Maybe this will solve the problem.
Does the behavior tree run? Is the pawn possessed by an AI controller? If both yes, maybe the problem is in the behavior tree itself? I suggest you debug using the “print string” node inside any logic in the behavior tree to see if it actually runs.
I added a print string inside the task. After the second enemy is spawned, it doesn’t print the string anymore. Is this the way to check the behavior tree?
And also I checked the AI Controller, it works fine. They can sense that I was in front of them, but not doing the behavior stuff.
Hmm. I can’t think of anything specific since I don’t know all your code and logic, but maybe you can check the blackboard keys to make sure you don’t have “Instanced synced” enabled on keys that you don’t want the enemies to share.