Accessed none trying to get blackboard

Whenever an enemy is spawned, it will always have this error:
Blueprint Runtime Error: “Accessed None trying to read property CallFunc_GetBlackboard_ReturnValue_1”.

This error is from the sight AI Perception. This error wouldn’t bother me too much, except it occasionally seems to cause the AI to not be able to see me at all, unless I damage them and “reset” the perception. I have the ‘Run Behavior Tree’ in my startup and even have a delay to make sure that everything can initialize. Here’s some images of the failing node and my startup:

Any ideas would help. Thank you in advance.

I can’t remember if ai_controllers have a constuction script but the run behavior shouldn’t have a delay at all. That should be the first thing done. Do you have a pic of the behavior tree because I doubt the issue will be in the blueprints you’ve provided. Also, you can run an ‘is valid’ node for the get blackboard to stop the error and to also put a print string off the not valid to output if it’s invalid.

1 Like

Hi, try to

(-) either plug “Self” into “Target” of GetBlackboard or

(-) directly use the blackboard variable instead of using the GetBlackboard function

I’m not sure what will happen if you leave “Target” of GetBlackboard empty. Most likely it will just use Null as target and will therefore fail and return Null as ReturnValue then.

Apologies if this has already been resolved – I found this issue as I had the same thing when trying to create some enemy patrol behaviour.

Blueprint Runtime Error: “Accessed None trying to read property CallFunc_GetBlackboard_ReturnValue”. Node: Set Value as Object Graph: UpdatePatrolPointBB Function: Execute Ubergraph BP Enemy Blueprint: BP_Enemy

I’d forgotten to change the Pawn AI Controller Class to be my BP_EnemyController on the instance of the blueprint that I had added into the level. Once this was done, the blueprints worked as expected.

It might be a little late for you, but could save the next person that misses this step.

Cheers

John

The blackboard will be initialized when you run a behavior tree, If you tried to access the blackboard before running a behavior tree it will return a none reference