Shader parameter control?

Godot Version

4.3

Question

I’m trying to change the tint factor of my shader. I don’t really know why and this is about all the (important) detail I can give. Thanks!


image


image

set_shader_parameter is a function

set_shader_parameter("tint_factor", 0)
1 Like

I think I have the line in the wrong spot/used incorrectly, because when I use it, I receive an error saying “Invalid call. Nonexistent function ‘set_shader_parameter’ in base ‘Sprite2D’.”

You need to get the material first.
$"stats menu/.../The Start".get_material().set_shader_parameter("tint_factor", 0)

2 Likes

Thanks, it works just fine now!