Hi,
I’m trying to use UE4 to do some arch-vis work. I need the ability to change between different styles in the level through a menu, which will change materials on some of the actors in the level.
I’ve got some ideas but I’m new to UE so I am not sure if there is an easier or better way to do this.
At the moment I’ve got my style changer widget which shows the menu and handles the logic of changing the styles. I was going to implement a global event system and have the widget broadcast the style that has been selected, and then have a blueprint component assigned to the actors that I want to change materials for. This blueprint will listen for the event and switch the materials.
Two questions - firstly, does this sound like a good way to handle this?
Secondly, none of this data needs to be set at runtime or dynamically; the styles and the materials to switch between are all pre-defined. What is the best way to handle this in the editor? I have created a custom struct which is used by my style changer widget which is an array that contains the name and a few other pieces of information of each style. I then wanted to have each blueprint component on the actors read that array and, in the editor, pre-populate it’s own array with the styles from the widget so that I can then assign materials. I can access the widget’s styles variable at runtime, however, I can’t find out how to run a blueprint in the editor such that the array will get pre-populated with the styles. Is this possible?
I’m currently using blueprints for this, but I can use C++ if it will work better.