Dynamic material instance not updating at runtime

so i made a simple scroll box to select a country that will appear as a flag when i hit play.


the countries and flags are taken from a datatable and I populate the scrollbox with a widget “bottoni”

then when i select a country, the flag’s dynamic material instance updates with the new texture.


The issue is all of this is working, just not at runtime.
As soon as i stop the simulation the flag changes to the one i chose.

I’m kinda new to unreal so any advice is welcome

Looks like you copy-pasted this variable from the level blueprint, cheeky - but it will not work.

You do not get an error when you compile this?!


In order to suggest a tangible solution, we’d need to know where / when / how this widget gets created:

image

Yes i do get an error. How can i reference that skeletal mesh otherwise?
I’m not sure if i understand what you’re asking me but here’s how the main menu widget is created:

You got me right. While there’s a lot of ways to handle this, here’s something that could fit into your existing script:

  • a new exposed variable in the button widget:

  • another one in the main menu:

  • in the Level Blueprint:

The direct referencing from the scene only works in the Level Blueprint

I do not understand how you get those nodes to work.
I may be stupid but I can’t connect them.

edit: nevermind i figured it out.

1 Like

so I di that but i’m only able to control one flag.


It does work at runtime tho so i guess the issue is solved(?) hahaha

Could you show the updated script for this:


it’s a lot

Looks OK-ish at a glance Scratch that, you’re sending just the last flag from the array. You do not need that first loop. Just send a specific flag to each execution sequence.

Yeah i figured.
Thanks for the help!

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