Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | J u s t N a t e |
i made a simple shader to change the ‘select_colour’ to the ‘new_colour’, it works in the editor but when i run it there are no changes to the character.
example:
also, how do i access the shader param in a .gd script e.g. Player.gd script, im pretty sure there are get_shader_param() and set_shader_param() functions, i just don’t know how to access/use them?
To use get_shader_param()
and set_shader_param()
, you need to call it on the shader material. So, use node.material.get_shader_param()
.
exuin | 2020-10-02 01:49
exuln, im not getting any errors but it doesnt update the colour in runtime.
func _ready():
$Sprite.material.get_shader_param(“new_colour”)
$Sprite.material.set_shader_param(“new_colour”, Color(180,82,82))
J u s t N a t e | 2020-10-02 01:58