Get a variable from another blueprint

I have two BPs, in one of them is a variable I need in the other too, so how do I get the variable in the other BP?

You just need a reference to the other BP, pull out the wire and search for “Get < YourVariableName >”. If you want to edit it you might have to make the variable editable.

I would highly suggest you watch the tutorials on BluePrints (not the quick shots) on the Epic Games Youtube channel since they explain most of this stuff.

thx, I’ll check out his channel,
but how do I get the reference?
I tried cast to but that didnt work

Casting only checks if the object you are referring to or any of it’s parents is the class you are casting to so from then on you can use variables and functions from it.

How you get the variable is depended on your case and preferences.

You can store it in when you spawn it, you can get it via hit or overlap events or by getting all actors of it’s type on the map.

There’s a lot of ways.

I would honestly recommend to first watch the videos before continuing. BluePrint is a relatively easy way to create functionality but you still need knowledge of programming to use it properly. Specifically you will need to know object oriented programming because that’s all games are. Tons of objects interacting with each other.

The videos will get you at least on a basic level so you can do simple things.