I don't understand calling a variable from another blueprint

I have tried to follow the documentation but I just don’t understand. I have made the variable public by clicking the eye to make it open. I have tried getting it in another blueprint, but the thing has a ‘target’ input. And everything I try plugging in there to get it to target the original blueprint won’t work.

First you need to get your player character or pawn, then type in “Cast to” then whatever your blueprint name is. Connect up your player character to the cast to object, then drag out from as “blueprint name” and you should be able to see your variables and get reference them properly. The pic I sent should give you a decent idea how to do it butIf you have any questions feel free to ask. Hope I was able to help :slight_smile:

Here’s a better example picture. So you start out by getting your player character, then from there you cast to your blueprint, so type in “cast to” and then your blueprint name. Then from there you can drag out from the blue node on the bottom right and type in your variable name to get your variables from the blueprint. In the pic the variable I’m using is vertical aim.

What do you mean by “Connect up your player character to the cast to object, then drag out from as “blueprint name””?

When I try doing that, a warning comes up under ‘cast to’. It says what I’m casting to doesn’t inherit from ‘character’.

The two blueprints I’m getting to communicate are both animation blueprints. What would it be called for that, because there’s no ‘get animation’ or ‘get skeletal mesh’ from something else.

What kind of class are you using? If you’re using a pawn, replace the GetPlayerCharacter with GetPlayerPawn or whatever the class you’re using for your blueprint.

Try making a variable reference to the other blueprint then. So make a new varible then when selecting the type, search for the name of the other anim blueprint, click on it, then select reference. Then drag that from your variables menu to your graph and connect it to the variable if it is static. If it’s not, connect it to the cast to function like in the most recent photo I sent.

Okay I think I might have figured it out. Try copying this:

So on one blueprint I have a variable that is a reference to the other blueprint. The reference variable is plugged into the target of the get for the original variable.

But when I run it, it’s clearly reading 0 constantly. Then when I stop it, there’s an error message, saying “accessed none trying to read property [reference variable]”

When I try using cast to, the cast to has a warning saying “[reference variable] is already a [blueprint I’m trying to reference]”

You forgot to plug get anim instance into is valid. I did that, but it’s going through cast failed out of cast to.

Does anybody else have a solution to this? It’s kind of annoying that I can’t do something this simple to get something to work.