Accessed None trying to read property

I am getting the following error:

Blueprint Runtime Error: "Accessed None trying to read property ZlorpClass". Blueprint:  ZlorpController Function:  Execute Ubergraph Zlorp Controller Graph:  EventGraph Node:  Branch

And the error is caused in my AI Controller class. This is what I am trying to do.

In this blueprint, I have created variables for my PlayerClass (Character) and my enemy class (Character). I am trying to get their locations so I know how close they are. But doing so gives me the following error. I tried casting but then I do not know what to put on the left"Object" side of the pin.

I think I will need a reference to put it on the left “Object” side of the pin. How do I get the reference. I cannot spawn them since they are already in the level.

How do I get my Player’s and Enemy’s Locations.
:

Access none errors can be a pain sometimes. If you don’t get a few of these a day, then the day isn’t over yet. I still struggle with these sometimes. Whenever you get this one, just see how your variable is being set. I won’t be boring you with stuff since I’m self learning UE4 but here’s the solution to get your reference. I tested that just now, works fine for me.

Great. So that solves my problem on getting reference to the player pawn. Any ideas on how to get the reference to my enemy character class.

Maybe something like this.

When you have some spare time have a look at this [Unreal Engine 4 Tutorial: Creating References][1] too by Nebula Games Inc