Quick answer: Godot 4 shader 'instance uniform' default value ignored on new MeshInstance? Defaults apply only to the material - instance properties start unset, requiring explicit init.

Shader has instance uniform float energy = 1.0;. New mesh shows energy = 0 until first set.

Set explicitly on spawn

mesh.set_instance_shader_parameter("energy", 1.0)

Instance properties default to zero in memory. Defaults in shader source are documentation only.

Or set in scene

Edit-time set via the inspector embeds the default in the .tscn. Spawned instances from that scene inherit.

Use a script default

_ready on the holding node: set the instance property. Centralized; safe for runtime instantiation.

“Shader source defaults aren't runtime defaults for instance properties.”

Document the per-instance shader property convention in your project. New contributors discover the zero-default exactly once.

Related reading