How would you change and revert and object material?
Hey guys, I was wondering how to change a material of an object and later be able to change it back to the original material. I am using a blueprint that allows me to pick physics objects up off of the floor and my final goal is to change the material to a less opaque material while I am holding the object, then simply change the material back to the original when I set the object down. I am having no trouble changing the material the first time, however, I cannot simply set the material back to the original because not all physics objects that I will be picking up have the same original material. Is there a way to possibly overlay a material and revert back to the original after I set the object down, or is there any other way of accomplishing this effect? Thanks.
asked Aug 12 '15 at 03:45 PM in Blueprint Scripting
You can store the initial material in a variable of type Material, then use that variable as input when you want to revert to your original material.
If you want to basically keep using the same material and only change one value, you could also use dynamic materials. These are more complicated to set up but very powerful. You'd probably have to make all your objects' materials dynamic, so depending on the size of your project this might not be feasible.
If this interests you, check out this tutorial series (particular parts 9 and 10): https://wiki.unrealengine.com/Videos?category=Materials
answered Aug 12 '15 at 05:35 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here