How to cast between two actors?

okay, I’m really stuck here and could really use a basic breakdown. I have an Actor blueprint that is holding this variable “score”:

this works great! no worries however I am now trying to call the same variable in another blueprint:

I’,m completely stuck on what to put into the object for this. I have worked with casting before but only in the character blueprint where I use the object “pawn” I’m struggling to work out what Objects i need for this, or how to set it up or work it out. if anyone could give me a hand or point me in the right direction that would be swell: :slight_smile:

thanks, Percy.

Yeah, but where I’m lost is how to reference it?

It depends. You can try to use “get all actors of class” node ( it costs performance if used frequently ). Or you can create variable in your small_hoop blueprint and make variable “editable”, than you can pick main_hoop from scene in details panel of small_hoop, or you can make variable “exposed on spawn” and attach main_hoop reference when spawn small_hoop. Also u can spawn main_hoop inside small_hoop blueprint and save it in variable there.

You mean like this? because I’m still getting a “cast failed” return?

Can you try making Variable not Object but Main_Hoop reference. And ignore cast to?

If you mean like this, no it just fires off a bunch of errors and the value only comes though as 0.

No set it as previous. With Details and not Set node. Default value.

Sorry could you be a bit more specific are you saying change it back to an object?

110171-like+this.png

No keep it Main_hoop but reference like this

You can’t its greyed out

wait i got it

Go to yor map, place main_hoop, place small_hoop. Select small_hoop and in the details window you can pick main_hoop from the map.

Okay, I tried two things here. I can’t change the default value in small_hoop still:

So you can see what I tried to do instead was create the reference inside Main_hoop then call upon it inside Small_hoop. but then I get the error.

Just do it on the map, not in the blueprints

Here i found a tutoral, may be helpfull

I have the same problem, Can someone help us?

Cast node does not get you object, it only changes type of varable to specific class, so you need to input the object you want to cast. In you cae i suppose you want to plug actor that overlapped which is outputed for “Other Actor” pin in event, plug it to “Object” pin in Cast node