Parameter change using Widget Blueprint

Hi everyone,

I have a little problem with Widget Blueprints and I hope for your help :slight_smile:

I have a simple interface as you see in the picture below. I just want to change the ColorSeats parameter from basic material M_Chair using my buttons. As you see, when I click on button it returns corresponding index and color. The problem is that the color is still the same.

I have:
Blueprint with chair, where I create dynamic instance material in construction script and enable input in the event graph.
Blueprint with single button, where I print index and color using OnClickedEvent. In the second picture you can see my overall idea for doing this, but it doesn’t work.
Blueprint with interface (few buttons) where I do nothing.
And of course level BP with adding interface to viewport and enabling mouse cursor.

My questions are:

  1. In which BP should I set the vector parameter value?
  2. How do I set the proper target? Because I think it is a MID issue.

Thanks for advance!

Greetings,
Maciek
30347-30348-

Thanks for answer, but it isn’t clear for me…

For now I just want to set the color of chair (which is component of class blueprint) using buttons. What should I have in level BP and what in the chair BP? I tried many ways but it still doesn’t work…

first, set it up so you can change the color of the chair without worrying about the GUI.

inside your chair blueprint, you can make a custom event called ChangeColor
and hook that up to setVectorParameter on your dynamic material.

then, select your chair in the level editor, open the level blueprint, right click and create a reference to the chair. using that reference, you can now access the event ChangeColor from your level BP.

make a custom event in the level blueprint called ChangeChairColor, and hook that up to call the chair’s ChangeColor event.

now in your UMG onClickEvent, you can use a console command node, and set its text to “ce ChangeChairColor”

then it should work properly.

Thanks for better way to do this, but I had that funcionality already :slight_smile:

Now I just want to get Image color after clicking button (image is on the button) and set that color to chair. The problem is to get information from other BP to this one with the chair.

Can anybody help?

I can change and set (or randomize) color of chair but my goal is to get color from button. Or collection, but it would be still depending on number of slot.

I’m trying to get this number (variable BigIntSlot) from BP with interface (called ColorInterface) and using this number want to get color from collection…but if I could get slot number then I would also get slot color.

Hope for your help again :slight_smile: