Casting Another Character Besides Player Character

Hello. When I cast to player character or player controller, I use “Get Player Controller/Character” just like in the picture. What do I use when I cast to another charachter, some AI maybe? Thanks.

87570-untitled.jpg

You can cast to Character itself or if you have a specific Character class, you cast to your character cast.

If you’re wondering how to find those characters in your level, you can get them by Get All Actors of Class and specify the target character class in that node.

I know that, that’s not what I need. What if I want to cast on another blueprint? When I cast to my character on another actor’s bluprint, I get ‘get player character’. What do I do in reverse?

I did it via Get All Actors of Class. Thank you so much man, much appreciated.

No, I want to know what should I get for Object:

1 Like

from which blueprint?

I want to cast to another actor (its a duplicated version of top-down character) on level blueprint.

Ok so you select that character in the level, go back to the level blueprint, right click, at the top you will see “add reference to …” the actor you have selected in the level.

You have to pass that actor to the other blueprint. You can either grab it via Get All Actors of Class, or make that character register itself to the other blueprint via function, or store a reference in the game mode or game state and access that from your other blueprint.