Help with Blueprint - Changing material on static mesh by clicking, then having it change back by clicking it again.
I am working on a blueprint when you click the light switch, the material on the static mesh swaps out for an identical material but it has emissive on it using Set Material. That works fine. What I have been unable to figure out is how do I get the material to go back to the original material when I click on the light switch again.
I did a search and coudln't find any info regarding something like this.
Any help would be greatly appreciated.
asked Jan 08 '15 at 08:17 PM in Blueprint Scripting
You can use a flip/flop logic to do that. Ie for each click alternate beween action A and action B.
A reliable method would be to add a boolean varible inside your blueprint called 'LightOn'. Then in your OnClicked Event handler (the one in the picture), you will first check if the value of LightOn is true or false (using Branch). If its false, then you will change the value of LightOn to true and then change the material to once with the emissive. On the other hand if the value of LightOn is true, then you will set it to false and change the material back to original.
answered Jan 09 '15 at 02:57 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here