Disable Shadows of Mesh Instance by code?

Godot Version



Is it possible to disable the shadow of a mesh instance 3d by gdscript?

Yes, here is the example

var mesh_name = get_node("MeshInstance3D") 
mesh_name.cast_shadow = false

Editor said mesh_name.cast_shadow is not a bool and it is ShadowCastingSetting. After correction it worked. Thanks for your reply.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.