Quick answer: Godot 4 canvas item shader's uniform reading the wrong instance's value? Per-instance shader parameters use instance_uniform; otherwise shared across all instances of the material.

Set parameter on instance A; instance B also shows the change. Expected per-instance isolation.

Declare instance_uniform

instance uniform float hp;

Per-instance storage. Set via set_instance_shader_parameter.

Or duplicate the material

Each instance gets its own material. Heavier; simpler isolation.

Audit uniform declarations

Per uniform: shared or per-instance. Decide deliberately.

“Shader uniforms default to per-material. Per-instance is opt-in.”

Document the per-instance shader uniform pattern. The bug class is silent until you notice it.

Related reading