Hello, I’m trying to set a material and shader parameter to a simple MeshInstance3D and then get the value of some things of said shader parameter in gdscript, but everything I tried still doesn’t work. It keep saying that the shader parameter is nil, even though everything else has a value. I hope the screenshot will help you understand. “heightmap” is always nil and terrain_mesh is a simple MeshInstance3D.new()
You are not setting the parameter correctly, it just needs the name of the parameter not the full path. terrain_material.set_shader_parameter("heightmap", texture) in this case.
Hello, I’m afraid it doesn’t change anything. Result still nil/null !
And I’m pretty sure the full path works too as I tried something else some days ago that had the full path and it still worked.
Pennyloafer’s answer didn’t change anything either, same problem.
(By the way I think the problem may lie not in the get_shader but instead in the set_shader as some very similar code I made worked when only getting the value of heightmap when the shader was applied manually in editor. But when setting the value in gdscript this problem arise)