The image shows that I have spawned the AI character however the AI Controller is missing.
I set the AI Controller in my AI Character blueprint in the details panel.
I believe that’s all I need to do for all this to work.
What could be a reason why Spawn AIFrom Class does not give me an AI Controller?
The AI spawns in the scene fine and i checked, only the AI is missing.
Also when I drag and drop the AI Character into the viewport/scene, it works just fine, the AI controller is there, its only when i try to spawn the character from spawn AIFrom Class it fails.
So to solve this problem where Spawn AIFrom Class spawns the AI but doesn’t have an AIcontroller on it I went to details panel of my AI Character and looked for Auto Possess AI > Spawned.
By default(I think) the “Auto Possess AI” is set to “Placed In World”. I changed it to “Spawned”
In Unreal Engine, the Auto Possess AI setting on an AI Character is crucial for determining how the AI Controller will take control of the character. This setting specifies when and how an AI Controller should automatically possess a character.
Placed In World:: The AI Controller will automatically possess the character if it is placed directly in the level within the Unreal Editor.
Spawned : The AI Controller will automatically possess the character when it is spawned at runtime through gameplay scripts or Blueprint logic.