How do I change the property of a Material from a GUI element

I’m currently using a material effect built into the renderer for a visual effect for my pause menu. It looks great when I open it up, however I can not close the effect from the pause menu itself due to it being a GUI element and not having access to the go.set property for my fragment_constants.

I’m aware I can just play a game of telephone using msg.post and a game object script but is there a way to set a material property from a gui instance?

You can use gui.get/gui.set: API reference (GUI)

1 Like

But the shader isn’t built into the GUI Itself, its in a separate object outside of the collection because its part of the loading screen as well.

That’s why it needs to be built into the renderer, because it needs to function regardless of camera position.

what I’m asking for is a GUI command to address something outside of the UI node, but I think that’s most likely impossible.

I guess this function is msg.post()…
Or for this kind of cross context stuff I always use defold-event library.
Just have a PAUSE event and let every component react to it.

You can avoid the extra game object script if you use a custom constants buffer in the render script. This way, instead of using go.set/gui.set you can change the shader’s constants by sending the values to the render script(using a message) and copying them to the buffer.