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?
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.