EDIT: PROBLEM SOLVED
I just needed to reference the shader in the code beforehand.
Here's what my code looks like in case anyone stumbles here.
func _ready():
pulse_outline()
func pulse_outline():
var material = load("res://Shaders/outline.material")
material.shader = load("res://Shaders/outline.shader")
material.set_shader_param("outline_thickness", 1)
Hello everyone.
I'm trying to animate the outline thickness of my object's shader in an out, kind of like a "breathing" animation, to indicate that it has to be clicked.
For now, I'm only trying to make my code act on the outline shader by telling it to set the outline thickness to zero.
I've went through a lot of videos and tutorials, even the Godot discord, and I couldn't narrow down the problem. It seems like there is an issue with using the "SpatialMaterial" that doesn't allow me to call on the setshaderparam function. However the shader I'm trying to act on (next pass) is not a SpatialMaterial, it's a ShaderMaterial.
Could you please tell me what is wrong with my code ? How can I get it to work ?
Here are some screenshots, thank you all for your help.
Node Setup and different Materials
Object