How to spawn an actor using variable?

Dont want to select actor to spawn manually by selecting in “Class” pin. i’m giving it using a variable “Character To Spawn”. but when i do that “Switch To Character” pin doesn’t show up. and cant use “Self Reference”. This all thing making the spawning work but now i am not able to possess the spawned character ?? what can i do ??

The Possess call only works for Pawns. Since a class variable is generic, i.e. any actor class can be filled in as variable, the Blueprint compiler has no way to find out that you spawn a subclass of Pawn.

Therefore: you can use a Cast To node to cast the output of the Spawn Actor to a Pawn. This fails if the supplied class in the Character To Spawn class variable is not a subclass of Pawn, but succeeds if a correct class is selected (e.g. First Person Character).

And after casting it to Pawn you can call Possess.

Well never mind i figured it already… Because i couldnt get the new pin to set self reference… i just had to save the reference of first (main) character in the 2nd (Spawned) character manually as game begins…
it solved the problem…

now i also know why we needed that self reference… and how to spawn actor with using a variable so i can spawn anyone just by changing the variable value…!!