Hello, in my game i wanted to try and spawn an AI with a basic AI controller class i made, when i pull the blueprint and put it directly into the world, it will work. But, if i try to spawn the AI by codes, he wont move at all, even though i already set SpawnDefaultController(), it is as if the AI controller wasn’t there in the first place.
So, the AI will spawn, but will not do anything. Am i doing the AI spawning wrong or is there another way to do it? Any help given is greatly appreciated.
ah found the answer, for some reason if i spawn from codes, the controller will not run BeginPlay(), as an alternative i made some functions to run queries when the AI is spawned.
i did put that in the constructor, i have my own custom AI class, which extends AAIController, which follow everything the shootergame had excluding the blackboard and behaviour tree. My custom AI will work if i put him in world by placing the blueprint directly in world, just not when i spawn him by codes
It means the AI Controller it’s going to possess only the pawns which were placed in the level before running the game. The ones that are being spawn at runtime are not going to be possessed; that’s why the code written by this post’s author was not functioning.