Spawn AIFrom c got 'Accessed Node error'

I using blueprint and C++ to create my game.
But when I try to create a blueprint to spawn my enemies, I got ‘Accessed None’ error.

My enemy blueprint is about this:

  1. Enemy Class (C++) → the base class ( inherent from ACharacter )
  2. EnemyPawn → Based on Enemy Class
  3. Battle Component → Add to EnemyPawn

If I direct place the EnemyPawn into Game map, it works correctly.
But when I using 'Spawn AI Class to create EnemyPawn, i got "Accessed None Battle Node` error, and it says the call node is my Animation Blueprint Node (Even the branch didn’t reach it)

heh, making some necroposting, but it may be useful for somebody

Had same issue while spawning enemies with “Spawn AI Class”, and got ‘Accessed None’ by enemy character references in enemyAI node, and vice versa. Had no issues with enemies placed on map.

3 hours of fighting with it leaded to understanding a simple thing - all casts and setting variables were linked to “event begin play” and was not executed at enemy spawn.

fixed this by next thing - i put event OnPossess as another execution point for all the execution line of casts for setting variables in AI blueprint, and same with EventPossessed in EnemyCharacter BP

So, maybe, topicstarter should use EventPossessed in EnemyPawn BP for creating variables at enemy spawn