Hi,
I have a set on components on a blueprint, each of these include a text and have a variable set to it.
How can I change all the child components with the same tag on it to one variable?
In this example, I have set a “Test” variable on the main blueprint.
All the child “SDI” components include a text variable (Name Device) and I want to set these to the “Test” variable on the main component.
Hi Crossroad1000,
One way would be to set it from a “Call in Editor” function like this:
It doesn’t have to be Call in Editor - it could be called from anywhere - even the construction script.
Hi there,
Thank you for the fast reply,
I guess I needed to be a little clearer, as I see now.
I want to set the variable of the Atem blueprint (“Test”) and then change all the components that have the same tag on them to change the variables called “Name device”.
I think in your example it cast to the main actor right?
Here’s a better function - you’d just call this to set the text of all of them.
This does assume that all of your SDI’s are the same class, or Subclassed from a Class that has the “Name Device” variable.
That cast is to the SDI class.
3 Likes
Thank you!
Is there also a way without casting? As I might want to do this to multiple different child component blueprints.
No, it does need that cast I’m afraid. What you can do though is create a Base Blueprint with the “Name Device” variable, and make Subclassed Blueprints from that for each of your other Blueprints. Then you can just cast to that BaseClass - and all the others will have access to the variable.
3 Likes