How to set shader parameter in multimeshInstance3D?

Godot Version

4

Question

How to set shader uniform parameter in multimeshInstance3D? It is so simple is one mesh. But in Multimesh I get error after error. I also can get parameters’ values, but not to change them. I only can change parameters through AnimationPlayer.

It appears that you’re seeking to customize uniforms on a per-instance basis, a task which might initially seem somewhat perplexing. To facilitate this, you must first enable the use_custom_data option. Following this, you should proceed to call set_instance_custom_data for each individual instance you wish to customize.

In your custom shader, it’s essential to employ the INSTANCE_CUSTOM keyword to manually retrieve the custom data associated with each instance. This approach empowers you to tailor the appearance of each instance independently, leveraging the unique data you’ve assigned to them.