Blueprint for toggle material not working


Need some help. Based on some tutorials and other info’s I’ve constructed a blueprint that suppose to change (toggle) materials with one key on a static mesh while in Game play. Guess I am doing something wrong because I did everything the tutorial said but still not working. Here are some insides of the blueprint:

I’ve made the material with two elements (elemnt 0, element1) so I can make the change. As I understood in the “Set material” function I should put the element index=element 0. and into “Material” should put the material that the static mesh would change into. Something like this:

But still it’s not working. I don’t know where is the problem. Btw my construction script is empty. Maybe I should specify some stuff there?? Guidelines are needed here :wink:


Put a PrintText node after the F in order to check whether the key fires at all; if it’s not printing anything, you need to enable Auto Receive Input in Class Settings (top toolbar) for this blueprint.

I did what you said, I put a PrintText node after the F and it printed text in the output log window, so I guess this means the key works, but still the material doesn’t change. What should I do next?

So you’re getting nothing at all when it comes to the material change, hm. As a test, could you create the most basic default material and try to assign it the mesh with the F key without the multigate (although this should not matter).

How many of these objects are there in the level? More than one?

Also, when you open the mesh from the ContentBrowser, do you see the slots?

I only have one object in the level that I want to change material, and when I open the mesh the slots look like this:

and when I press the F key while I’m in the box collision on the mesh, the event graph looks like this:

And still doesn’t change anything!

I fixed it. The problem was in the material. In the Content Browser, open the material and in the Details, under “Usage” I checked the box “Used with skeletal mesh”. I tried this with different materials, and the blueprint for toggle material works only with the materials that have this box checked.