How do I manipulate the properties of a SPATIAL MATERIAL through code?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Dumuz

I keep finding stuff for ShaderMaterial, but it seems like the same calls don’t apply. I think?

I just want to change the UV offset in code. But I don’t know how to call it in script

This is what I attempted from what I found about shader material’s, but I think it’s different for spatial materials:

$Floor.material(0).set_shader_param("uv1_offset",midpoint)

Please help.

Thank you.

:bust_in_silhouette: Reply From: Dumuz

I figured it out.

You call it with “node”.get_surface_material(0) first.

I used it as a variable. Then attached the parameters I needed to change, I.E;

mat.uv_offset