Casting to actor

I am casting from my player to an actor but what should i connect into object on cast node?

1 Like

Use get all actors of class and select your actor there .
Drag out from out actors and use a get node.
Out of the get node will be your object

The Object pin on the left is where you insert your player in this case and the pin on the right that says “As Actor” is the result of the Player being cast as an Actor.

What if there are 4 actors? What if there are 100? What if you do not know the index? This is bad advice.


I am casting from my player to an actor but what should i connect into object on cast node?

Perhaps you could expand on this. The way of obtaining a reference (so casting can happen) depends on what is going on. So what is happening? How is the player supposed to know which actor? Are we looking at it? Touching it? It’s in the player’s inventory? Some other interaction?

Perhaps there’s only 1 of those actors in the world, ever; and Get Actor of Class could work. Crude, but hey, it’s your game. :innocent:

3 Likes