WidgetSwitcher Code not working

Hello everyone , I’m facing a problem with my blue print and actually don’t know the solution for it .

I want to change materially interactively I made 2 variations .

1- Option one its static meshes actors tagged with (Wood-1)

2- Option two its static meshes actors tagged with (Wood-2)

at the start of widget I bring all actors of class with tag .

then i do the code on my widget switcher for the items .

this code working perfectly .

when i Copied the buttons to the other tab and made the code it’s not working .

just working for variation 1

image

I added a print to make sure it’s working and it was giving messages but no material changed .

your help appreciated if i find the solution i would post here aswell .

Hello,

Most likely cause is that you never set up your parameters inside wood-2 material.

actually all are set i made all of them .

This isn’t what I meant. Did you actually setup up parameters for each of these material inside Material file?

I made an index variable to point out which texture i want in the array .
the wood-1 tag actors working perfectly fine .

the wood-2 actors doesnt work

Get wood-2 array and check it’s length before running the loop. I assume it’s not empty because print string fires of, which lead me to asking about your material setup.

I made 2 dynamic materials each material was set for each set of actors .
Material ( Wood - 1 ) and material ( Wood - 2 ) then i set a dynamicmat-1 and dynamicmat-2 then did the whole process but i don’t know where is the flaw .

is it the widget or the code ..

thank you for your effort to figure out the issue .

this is in the first tab wood 1 material changed perfecty for lower cabs

in the second tab it just giving me the array actors but no interaction at all

All good, I understand.

Can you please post a screenshot of Wood-2 material graph.

when i press the button it fires like this ignoring start is that the problem ?

I need to see what’s inside this file.
My guess is that you never setup Gloss and Texture parameters inside it, so your logic fires of but there is no matching parameters inside Wood-2 material to actually change anything.

Material Wood - 1

Material wood - 2

I replicated your setup 1:1 from screenshot and it does work for me.
You can right-click on Texture Sample and convert it to parameter. You don’t need the param tex object node at all. I posted a screenshot above with how it should look like.
If this doesn’t solve it, issue is with blueprint code but really hard to tell, some screenshots are not readable.

sadly didnt work but i noticed in wood 2 it really changing the glossiness but not interacting with texture , I did convert texture to parameter as you said in both materials . wood 1 option still working - option 2 just changing glossiness :smiley:

Okay good.

Can you try adding a very district texture manually for wood-2 material instead of fetching it from array? Also check if array is not empty.

Have you tried using wood-1 dynamic instance (since it’s the same as wood-2) where you plug in Dynamic Instance 2 (Set Material Node)?
It’s very strange indeed, it must be something silly at this point :slight_smile:

1 Like

it did fix looks like index value i forgot to adjust the index value and you were not able to view cuz of SS quality now it seems to work perfectly fine .

I really do appreciate your patience and help .

2 Likes