Accessing shader parameters from another scene

Godot Version



I have a world scene:
and a hud scene:
in the player script i want to acces the shader parameters from speedlines in the hud scene i looked throught the topics but i could not find an answer

TIP: Doesn’t make any sense to mix PascalCase and snake_case, you should stop that.

You need to reference the HUD scene in the World scene somehow.

# Replace this with whatever method you want to get the node.
@onready var speedlines = get_tree().root.get_node("Hud/SpeedLines")

Then you can set the shader parameters

Something like this:

if speedlines.material is ShaderMaterial:
    speedlines.material.set_shader_parameter("speed", 10.0)

i just moved it into the same scene because it would return a null value now it works