When casting to an actor, it always fails because of the wrong input

So, since the answerhub decided to remove all the work I put into writing this up once, I’ll keep it short.
This is what I have:

67444-screenshot_4.png

I’m trying to cast to the Hook (A normal actor BP) from the Level Blueprint.

But the Input for “Object” doesn’t accept anything. I’ve tried many many many different nodes and none of them cause the Cast to succeed. The only one that I have found that doesnt cause an outright error is the “Get owner” Node, but even that causes the cast to fail. Like so:

So I beg you all, which node exactly is it asking for? I have done SO much research on this and read all the ‘theory’ behind casting, but for over 2 months now I have yet to figure this out. Please help, If this isn’t the right way to go about getting information (such as variables) from an Actor, please let me know how else I can do it. This has been a huge annoyance to me lately and I just cant get it right.

TL;DR, What node do I input for an actor BP under “Object”?

Hi Smileymaster,

The cast node wants an instance of an object, not the blueprint (which is like a template used to create instances). If you want to use the level blueprint to cast an actor contained in the map, follow these steps

  1. Select the actor in the map
  2. Open the level blueprint
  3. Right click in the event graph and choose Create a Reference to [Actor]

67482-create_ref.jpg

  1. Connect the instance node to the Object pin of the cast node

67483-cast_to_hook.jpg

There are other ways to find instances of objects, Like the GetAllActorsOfClass node. It allows you to specify an actor type (this is where you’d enter the Hook blueprint) and will return an array filled with every instance of that class that currently exists.

Hope this helps you.

Shweeeet!

I think it worked! wooooo~ Thank you so much man :smiley: