Variable with "actor as selected type" always returns null, why?

ehm, no. The problem is that you didn’t understand the whole topic by now no offense.

Casting means, that you convert an Actor or what ever Class you got your fingers on, to another class. An example:

Your Player as well as an Enemy are from the “Actor” class. They are both childs of the same parent. Now you have an Overlap Event for a Trap that should only damage the Player, but not the Enemy.

The Overlap event reacts to every Actor, so as “OtherActor” you get the Overlapping unit as an Actor Class Instance. You have no idea if it is your Player or the Enemy. If you now try to cast that to the PlayerBlueprint Cast, the Cast will only succeed if the Player is really the one jumping into the Overlap. The Cast will fail for the Enemy.

Casting is also important to get specific variables that you’ve created in your Child Classes. Actor Class for example doesn’t know about Character specific variables. But if you cast it and the Actor is really a Character, you can access the Variables.

For your NULL or Accessed None problem:

A Pointer or Reference variable can be empty (NULL). If you create it and don’t fill it, it will be empty and you shouldn’t be able to use it like you want (and you will get the Accessed None Error). It doesn’t matter if you have an Instance of that class in your Game at the time. You will need to fill the Variable with a reference of that Actor. Either by overlap event, raycast or other things.

You COULD use “GetAllActorsOfClass” and get the 0 index of that array, but that is the worst thing to do! If the Actor is already placed in your scene before you start the game, you can get the reference by using the LevelBlueprint. It is the only Blueprint where you can get a direct reference by selecting the actor and rightclicking in the event graph.