Switching Materials on a mesh using Blueprints

Hello,

I’m creating a Status Aliment system and I’m working on a status called Stone. This would change the character’s material to a stone material and block their input for a brief period of time. The issue I’m having is switching between materials. With my current setup, it switches the material to the default grey material. Is there any way to make this happen correctly? I can’t seem to find anything online about doing this and I kinda remember there being a content example with a constantly changing material, though I can’t seem to find it.

This is what I did to change the material of the mesh at runtime,

Thanks,

Thanks! Unfortunately this is just giving me the default material :frowning:

Well is it possible for me to have this issue because I’m using the player character which has multiple materials on him? I see where you can choose by index, but still I’m wondering if this is even possible.

Yes, you can change the material by index. “Set Material” node has element index. Specify which index you want to change and maybe that can work.
If that can’t work, can you share your blueprint image?

Thanks,

Here it is. It’s pretty much the same as the picture above, except I am getting the player character’s material and I am attempting to change that. I would really actually like to make it change gradually, but If I can’t get this working, I know for a fact a gradual change would be a lot harder or impossible.

Open your stone material and in that go to “Usage” section and check “Used with SkeletalMesh” option, that should fix it.

MaterialSettings.PNG

Thanks,

Thanks so much! It worked! Wish I would have checked the material settings before I made this post! haha