I recently added an enemy spawn volume to a level in my game and I get the following error for each enemy spawn:
“Blueprint Runtime Error: “Accessed None trying to read property ControlledPawn”. Blueprint: BTService_DistanceToPlayer Function: Execute Ubergraph BTService Distance to Player Graph: EventGraph Node: Set Blackboard Value as Float”
When I place the enemies in the level, this error does not occur. The enemy AI I’m using this reference code for still operates as intended, but it still throws this error for every spawn. I’ll link the Blueprint code it has an issue with:
Looking around at others with similar issues, it seems maybe it does not see my object variable ControlledPawn as set when the enemy spawns? I’m not sure what to do to prevent this error from triggering. Any suggestions?