# Blueprint for toggle material not working

**URL:** <https://forums.unrealengine.com/t/blueprint-for-toggle-material-not-working/408417>\
**Category:** Rendering\
**Tags:** toggle, unreal-engine, question, Blueprint\
**Created:** [October 31, 2017, 5:32pm UTC](https://forums.unrealengine.com/t/blueprint-for-toggle-material-not-working/408417 "2017-10-31T17:32:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_1c00765c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1c00765c](https://forums.unrealengine.com/u/anonymous_user_1c00765c)\
**Post date:** [October 31, 2017, 5:32pm UTC](https://forums.unrealengine.com/t/blueprint-for-toggle-material-not-working/408417/1 "2017-10-31T17:32:14Z")

</div>

Hi,

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:

 ![218564-staticmesh-component.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/0/b/d0bc40f869caf13b4d54d289a729d81cd21c1272.jpeg)

 ![218565-event-graph1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/1/4/f14c819ed80f18585357e815c5feae4a2ff53edf.jpeg)

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:

 ![218566-setmaterial-settings.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/4/984afc23e62f08f5cd68ddc9be3aab841d3b00c2.jpeg)

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 😉

Thanks!

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 31, 2017, 7:28pm UTC](https://forums.unrealengine.com/t/blueprint-for-toggle-material-not-working/408417/2 "2017-10-31T19:28:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_1c00765c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1c00765c](https://forums.unrealengine.com/u/anonymous_user_1c00765c)\
**Post date:** [November 1, 2017, 10:28am UTC](https://forums.unrealengine.com/t/blueprint-for-toggle-material-not-working/408417/3 "2017-11-01T10:28:05Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [November 1, 2017, 12:59pm UTC](https://forums.unrealengine.com/t/blueprint-for-toggle-material-not-working/408417/4 "2017-11-01T12:59:07Z")

</div>

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?

 ![218675-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/0/a/10a8c8199686d69b4d89bd19f396f18feec53850.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_1c00765c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1c00765c](https://forums.unrealengine.com/u/anonymous_user_1c00765c)\
**Post date:** [November 1, 2017, 1:26pm UTC](https://forums.unrealengine.com/t/blueprint-for-toggle-material-not-working/408417/5 "2017-11-01T13:26:05Z")

</div>

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:

 ![218676-materialslots.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/7/2775cc3cb93ec9b92e2a05a46fd474e8319f4ff5.jpeg)

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

 ![218677-keyf.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/3/773271440876299ab8e383eff6fa3b44390a27e2.jpeg)

And still doesn’t change anything!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_1c00765c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1c00765c](https://forums.unrealengine.com/u/anonymous_user_1c00765c)\
**Post date:** [November 2, 2017, 7:03pm UTC](https://forums.unrealengine.com/t/blueprint-for-toggle-material-not-working/408417/6 "2017-11-02T19:03:43Z")

</div>

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.
