Refresh Structures

Hello, in my level Blueprint, I add a structure allowing me to store data and send it to several blueprints. Unfortunately I am unable to retrieve the values in the blueprints. I have a feeling that the structure is not updating.

Do you know how to proceed?
Thanks
Julien D.

Hey @JDARRAS, have you tried creating a new instance of the structure and saving that into the variable that stored the previous struct? I’ve had the same issue of structs not updating its values in the past.

Hello Kribbeck,
Thanks for your answer but I’m not sure to understand. I have to create a variable from “get MyStruct” and call this new variable from my blueprint where I want to read the datas ?

In my case, Inside Level Blueprint, I want to set the structure and in few other actors blueprints, I want to get informations contains inside the updated structure.

I try between LVL_Blueprint and Actor Blueprint or between 2 actors blueprints but without result !

Do I need to configure Variable Details ? Editable ? Spawnable ? …
Julien

Maybe I’m misunderstanding but just to clarify, once you’ve created a struct it functions like any other variable. So just like you need to set and read floats, bools, object-references etc you have to do the same thing with a Struct.

It does not do any kind of blueprint to blueprint communication automatically.

If you’re actually having the blueprints getting a reference to the level-blueprint and reading the struct from there, or the level-bp is getting references to your actors and setting the struct and it’s still not working, then you’re going to have to post screenshots of your nodes for anyone to be able to help.

Hello Sportbil,
Thanks for your answer, I try and I succeed to get the real data.
I don’t understand why we need to refresh manually the variable of the struct include in the actor Blueprint from my Level Blueprint ? Why the struct is not updated automatically ?

Julien

A struct is pretty much just a way to organize your data, nothing more.

So your question is kind of like asking:

“I have a String variable called “CharacterName” in 5 different actors, why does this variable not automatically contain the same text in all of them”

I thought structure was like a variable for the whole project. A variable that can be shared between blueprint? From what I understand from reading you, no!

Is it possible to have a variable for all blueprints or HUD?

If I read you correctly, I will have to update my Struct variable from the level blueprint in all actors blueprints where I want to retrieve the data? Even though the variables in the actors blueprints have the same name, I will have to call them one by one? Complicated.

Yepp your understanding is correct, there’s nothing global about structs.

If you want to have something like global-variables easily accessible from anywhere during the lifespan of your application you can store/retrieve them from the game instance.

2 Likes

Hum,
Thanks a lot for your help !
Sometimes, Unreal is really complicate !!!