material change using mobile touch inputs

Actually, I am making a project ad I have successfully packaged it for android now I want to change materials in the android gameplay but it’s not happening as I made it by using UI and simple basic variant changing inputs.
Can anyone help how to change materials in the android gameplay using the touch inputs of android???

Hey there @GreeyaJini! How are you attempting to change the material? I can definitely take a look at your setup and correct it! May I see the blueprints/widgets?




these are my blueprint and widget and I am using level variants set to change material

Ahhh I’ve actually never had the pleasure of working with the variant system! I’d usually change the material directly or use material instances. I think the first place to start would be the verify the variant switches worked. I believe that bool output is a check for it’s success. Print those and see if it’s failing there.

Thanks for your help and reply. I have checked the outputs in gameplay and also in the windows packaged project of mine and it plays well and changes material but as I packaged it for android it shows the buttons but doesn’t change the material…

Does it work during android preview in editor? If not, we’ll have to see where the failure is. It’s not likely the material change that’s failing but something higher up the chain like input. Pop a print statement behind the input tied to it first and foremost and one at the end of the material change. After that let me know if they both fire off during android play.

Worst case scenario they both fire and we need to check for an error in the logs or you can run it through the debugger and keep a watch.

can you tell me how to change material without using a variant set as I am basically and usually uses that one only may that can help

and I wanna know how can I change material by using the blueprint class???

No worries! So you’d just use the Set Material node and it’s applicable to all devices.

Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.

Here’s a quick tutorial that shows how to change the material using a set material node, and also a way to blend from one material attribute set to another. If your material types are the same you could blend and make a smooth transition as well if you’d like.

thank you so much @SupportiveEntity for your help

1 Like