#want to edit values of shader in script
36 messages · Page 1 of 1 (latest)
this also doesnt work @last bridge
ye sure, thanks
yups, same
to which node is the material attached to?
are you referencing the material in the project folder?
to a MeshInstance3d called range
the script is attached to this MeshInstance3D and then im using 'self' to override the material
try doing directly on the material on the mesh
so now I have a MeshInstance3D with an PlaneMesh an added to the PlaneMesh I have the shader, I dont really understand what you want me to try
I also havent done this
the line_color uniform is not defined as a source_color. so you can't set it with color
but that of cource only counts for that one parameter
oh i see now. you don't have to write "shader_param/radius", only "radius"
still doesnt fix it
ah my bad, didn't realize that you already tried that
Now I have the range_indicator shown, but from the moment I start my scene, I dont getanything
could be a problem with z-fighting
and also the standard color is red, but in the script I gave it a greay color, so the script is not overriding the standard values of the shader
so I dont think its a z thing
try putting the mesh a bit higher
just because the changing of the parameters doesn'T work doesn't mean that the mesh should be invisible
material_override.set_shader_parameter("radius", 10.0)
I meant changing the material_override directly
if I do it like this, I get a null error
Attempt to call function 'set_shader_parameter' in base 'null instance' on a null instance.
you also have to directly put the shader material as the material_override inside the inspector.
Ow okay, will try that, need to go now, so will try it tomorrow. Already thanks for all the help.
and you don´t really need self., you can call material_override directly