How can I make a variable with the type of an AActor?

Why you need to cast? Plug in UClass direcly does not work?