Hello, Is there a Get all variables of Class? I would like to make an array or get a copy of all the all the variables of a certain class and make an array of the or copy. Currently I drag each one onto the Event Graph and then manually plug them into a make array.
no to my knowlege that doesnt exist. i dont think it ever will either as it logically would make no sense. trying to create an array of things that could be of many varied types would be impossible let alone trying to use that data in any practical way. imagine a get all variables that consisted of: a int, a string, a character class, mesh, map of ints, and an array of names, that would be weird right. also theres nothing you could do with the data at that point, you cant get a value of character, you cant get index 1 of a single variable, you cant read a character like a string. it just makes no sense.
i dont know your situation or use case but you may want to look into using a struct for your data. a struct can contain many variable types but it is predetermined and you can access each one as need be.
Thank you for the reply ThompsonN13, it would be for only one variable type. Example, you have 100 border color variables you want to change in a Widget Event Graph. The only option I had found was to manually drag each border color variable onto the graph and then plug them into a make array, they are all of the same type. It seems like it would be so much easier if there was a “Get All Variables of Type” node. Included is a screen shot of the BP, maybe you can think of a better way. I cleaned it up using the array, before there were 80 branches :0
In the picture, instead of having all the border color variables connected to the make array, there would be just one “Get All Variables of Type”,that would plug into the “Get Copy”, talk about saving a lot of time not having to drag all those variables onto the event graph.
why are you not just using a variable array? you could have one variable that is an array instead of having a ton of separate variables. to create a variable array just create one variable as you normally would then with the variable selected (in the variable section of the myblueprint panel) go to the details panel and click the little icon next to the variable type (should look like a sphere) then in the dropdown click the symbol of 9 squares. this will make that variable into a array of variables. once you compile again you will be able to set the values as needed. you could also make it public if you wanted by clicking the eye to make them editable from the details panel in the level editor.
i made this suggestion without looking too closely at your bp, it seems like your setting the color of the border on things. to accomplish this specific case i would create a binding which you would use for every border then when the binding is updated they would all update automatically, or just create a single variable and use the bind button to bind the variable to the brush color.
on a different note your script doesnt look very performant. maybe theres something im missing but it seems like you have a ton of things your setting the color to black on and your doing it every frame. also im guessing your probably new to all this since your using the get all actors of class and a get 0, theres much better and more reliable ways to do this.
Than you for the update again! I was going to use the array but like you said it will not work with border variables, a few others do not work with the array either.
The reason I did the array is because i did not want to create 80 different bindings. Yes, I am new to this and try to learn about more efficient ways of doing things.
you can use one binding for all of them. basically on the first one you click create binding and set it up then on the rest when you click bind it will show the binding you already made and you can just select it. so you will only need to create one binding then just set all the borders to use it.