How to change a texture using "for each loop".

Hi all, I was engaged in changing the colors of the character and created a “scroll box” and how do I now make the next element with a different texture.
Here’s the video I used to make: https://youtu.be/KvwHSaoAHoA?si=hymDBon53Rqr9U7f
timecode: 8: 05
And where I left off


P.S.
I decided to remove the text and now I’m just wondering how to change the texture in the same way

1 Like

It could work something like this depending on how many materials the character has and if you want to change/switch them all or just a few of them but here is an idea how to do it:

1 Like

I won’t give you many details because the translator translated it wrong
I have 20 materials ( textures )
I need that each of them can be used to change the color of the player from the widget
Thank you for responding
I’ll take care of your way

Are there buttons on the widget where you click lets say yellow color or red ? Then you can easy set it up on each button to change the texture/character matrials. On the buttons clicked/pressed and not on the “event construct”.

1 Like

Yes, I have buttons, forgive my knowledge of English at 0, and the translator does not translate correctly

Ok then set it up on the button in the widget to change the character material elements. Green button changing character material to green then yellow and so on for each button..

If your character has 2 or 5 material elements or so then set them all to the color you want.

P.s. if you want to change specific material elements on the character and not all you will have to add them in the “element index” and find out in the character mesh which index they have (the exact ones you want to change if you say you have 20). gl

1 Like

Thank you
I’ll start fixing it

1 Like

I did everything you wrote, but an error appears:

Blueprint Runtime Error: “Accessed None”. Node: Set Material Graph: EventGraph Function: Execute Ubergraph Material List Blueprint: MaterialList

1 Like

You will have to set the materials befor they are called in the widget. You can use “IsValid” node on the materials befor they are changed. If you want to fix this i can point you to this tutorial https://www.youtube.com/watch?v=x5yx7XqZrrA

1 Like

Thank you I’ll do it

1 Like

Thank you, I was able to solve the problem
Thank you very much!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.