Spawning AI enemy when overlapping triggerbox

I’m hoping someone can tell me where I’m going wrong here. I’ve got a trigger box set up that when the player overlaps, it spawns an enemy at a point I’ve selected in the level and then heads between 2 waypoints that I designated in the trigger box blueprint. Unfortunatly the enemy spawns but does nothing and I get the following error:

Error Blueprint Runtime Error: Accessed None trying to read property CallFunc_GetBlackboard_ReturnValue from function: ‘ExecuteUbergraph_BPGoomba’ from node: Set Value as Object in graph: EventGraph in object: BPGoomba

Triggerbox Blueprint:

AI Blueprint:

The idea was that I would place the triggerbox in the level along with target points, select triggerbox and enter target point values and then good to go. Can anyone help?

I believe it’s because Self simply returns the character. What you want is the AI Controller of character. This is assuming that the AI Controller is what runs the Behavior Tree, but this should work.

This is assuming that BPGoomba already has a specified AI controller before being Spawned or Places into the world, and that it’s allowed to be possessed by that controller (check the Class defaults of BPGoomba).

Thanks for the suggestion but that didn’t work, if I add the BPgoomba directly into the level and input the targets there it works. But if I spawn it from the trigger box it does not carry across the values set there and comes up with an error that it is accessing nothing for targets.

Edit: Ahh apologies I didn’t change ai to spawn, it works as intended now, many thanks :slight_smile: