I've created a MaterialShaderGraph ShaderMaterial that possesses a parameter I wish to change using gdscript.<br /><br />In the ShaderMaterial inspector dialog, mouse-hover tells me this parameter is called "shader_param/color"<br /><br />I know that for shape-keys, the relevant parameter is called "morph/keyname", so object.set("morph/keyname", 0.5) changes the value of the morph target.<br /><br />Yet when I try object.set("shader_param/color",Color(0.5,0.5,0.5)) or any variation, nothing happens.<br /><br />I assume I need to somehow get the material, or the shader.  But how to do this is not apparent.<br /><br />All help supremely appreciated.

[tt]get_material().set_shader_param("param", value)[/tt]

get_material().set_shader_param("param", value) results in the following error:Invalid call. Nonexistent function 'get_material'

Oh, sorry, are you working in 3D? Then it's different. It looks like it's [tt]get_material_override().set_shader_param()[/tt]

7 years later