how set spatial material flag transparent in gdscript

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

hello

i can set transparent in spatial material in the editor but how do that in gdscript? i tried looking in the docs, flags_transparent, set_feature, etc…

:bust_in_silhouette: Reply From: Jummit

Set flags_transparent of the material to true:

var material = SpatialMaterial.new()
# Enable transparency.
material.flags_transparent = true