I'm curious about how to implement a feature that changes the material color of the floor each time a button in the ListView is pressed.

In Unreal Engine, there are buttons used in a ListView, and each button is different. I need to set it up so that the material color of the floor changes each time a button is pressed.

When not using a ListView, I implemented this by connecting each button event to the Variant Manager node. However, since there is only one button event for the buttons applied in the ListView, I am curious about how to change the floor’s material color according to each button with just one button event.

Even if I try to store the Variant Manager in the structure, only the level variant is saved. The Test color value for the floor’s Blueprint is not being saved as the default value.


I am planning to implement a feature where clicking a UI button using a ListView in the top-left corner changes the colo

UMG_ListViewEntry




UMG_Main



Data Table Setup (TestDataTable)
image (9)
Struct Setup (TestStructure)

Button click event for use in ListView


ListView X & Variant Manager Setup

V
ariant Setup

Floor BP Setup
image (15)

You must call your data object from your ListItem widget

In the data object you create and call an event dispatch:


Here you can set any kind of data in the dispatch directly from the relevant data object.

In your main widget when you create each data object you bind to their event dispatch

Now you have the correct data in your OnColorChange event in your main widget when a button is clicked. You can calculate the color here if you haven’t already, change the color of the floor directly or send the data to another manager object that handles that.

1 Like