Spawned AI Enemy does not behave normally

I’ve made an AI Enemy and a Behaviour Tree and when I place one or several of these AI Enemies inside the level, it works perfectly.

However if I spawn AI Enemies via Blueprint, it seems that the Behaviour Tree does not activate any Task or Service anymore, resulting in the spawned AI Enemies running at the 0,0,0 coordinates instead of finding a real location to go to like their pre-spawned brethren do.

How do I fix this?

The method I use to spawn AI Enemies is:
→ Spawn Actor from Class (AI Enemy) → Spawn Default Controller

Try using SpawnAIFromClass. In newer versions Spawn Actor should work fine for AI, but if it doesn’t SpawnAIFromClass is the way to go.

Cheers,

–mieszko

This works perfectly!
Also I want to mention:
Inside the Enemy AI Controller don’t use Event “Begin Play” but instead “On Possess”.

Thanks Mieszko for the fantastic work! Loved the AI you made for previous games, keep it up :slight_smile:

1 Like

Dude that’s exactly what i needed Thanks a bunch