I’m just trying to make a quick and dirty drone NPC. (Enemy, utility drone, that type of thing.)
All I need is something simple. Very simple. No Behavior Trees, No Branches, Nothing like that. I have a BP_Drone, and an AI_Drone class. All I need the drone to do right now is either go directly to the player character, or, eventually, go to a specific location. Move To Location or Actor is all the functionality required.
My problem: If I drag the drone into the level at design time, it works fine. However, if I Spawn the drone in using either Spawn AIFrom Class, or even Spawn Actor of Class, it just sits there.
I have another NPC that works just fine when spawned. Both use the same basic functionality. The main difference is the working NPC is just an actual skeletal model with animations attached. The drone requires no animations.
Essentially, all I need is a BeginPlay with the MoveTo, and then destroyed when the goal is met.
I’ve tried searching for an answer, but haven’t found anything.
Don’t know if it’s a bug or what, but in the end, I just decided to scrap what I had and created another BP_Drone2. For some reason this one is working as it should. I really can’t explain what was going on, but at least this seems to be resolved.
Additional Note: I started running into a similar issue when adding new functionality to the basic drone. It would work when I dragged it into the level, but not when I spawned the level.
It turns out that I had to add a Delay after the Event Begin Play and before I sent the instructions to start the roaming. After I did that, the spawned drone now works as it should. (Except NOW for some reason I can’t get the Hearing aspect of the PawnSensing component to work. Works just fine if I create another BP with the exact same code. But not in this one. I’m working on that today to try to get it sorted out as it’s intended in the gameplay for the player to use a device that generates sound to lure the drone to a certain area where it can be destroyed, or at least out of the way of the player for a temporary amount of time.)