Been trying to figure this out for weeks. Watched many youtube videos including virtus series and haven’t seen a straight forward answer to this:
BlueprintA has variableA which equals 2
BlueprintB has variableB which equals 0
I want variableB to equal variableA
What do I need to do to achieve this?
I know this has to be simple but I just can’t figure it out for some reason. Every other program language is pretty simple as far as this goes.
Its a real simple question, that part’s true. But because Blueprints copies aspects of C++, the answer isn’t simple, its more of a puzzle. To learn all your options regarding BP comms watch LiveStreams like this . But for now here’s two options:
Store a shared variable in Gamemode that both BP’s can access by using the Get Game Mode node. You will need to Cast To the current Gamemode (check in Project Settings -> Maps & Modes, to get the active Gamemode name). That way neither BP needs a direct get / set, they can do it all indirectly.
I’ll have to try that.
Use the Get All Actors Of Class node to get a reference to BlueprintA & BlueprintB… Then you can directly access their variables. Caveat, this will only work properly if there’s exactly one instance of BlueprintA & BlueprintB, otherwise it isn’t practical.
Yea what I’m doing is creating 25 instances of a blueprint in the game world, and then I need to get randomly generated values off of them. Thanks for the help! +1
EDIT:
Just to let you know the first tip helped me get over my dilemma. I watched that video you linked before, but I’m going to have to watch it again because I clearly missed some big tips.