Texture change in Runtime

Hi, I want to turn a lerped Texture Sample on and off. It’s an amor texture on the skin of my character mesh which should be turned on and off by blueprint scripting. I think parameters are needed but I don’t know how to arrange them right so I can change the texture to be used in creating the final material or not.

Thanks :slight_smile:

Hey Taratus. To be able to access material parameters from within blueprints you’ll need a Material Parameter Collection. Inside create a Scalar parameter called Switch. In your blueprint you’ll be able to access this parameter through Set Scalar Parameter Value node. Pressing of a certain button in the game would change the boolean state of Change Material? variable. In your material add Collection Parameter to drive alpha on your Lerp. It’s that easy.

It works, thank you for the great explanation. Now I realised that it is changing every characters mesh texture because they use the same material. Is there a way to only change it for one character without creating every character his own material? :slight_smile:

If you only have a few characters then the correct way as I see it would be to use Dynamic Material Instances. Read about them in Wiki: Instanced Materials | Unreal Engine Documentation

You don’t have to create multiple materials but you’ll need multiple material instances that will link to a single parent material.