Can I change my GLB Model Color on runtime?

Hello Reader,
I’ve been working on three.js and successfully loaded my GLB model, but now I want to change its color during runtime, can someone guide me with it please?
This is my model:

warm regards.

Since your glTF asset consists of more than one mesh, use the following approach in your onLoad() callback:

root.traverse( ( object ) => {

	if ( object.isMesh ) {

		object.material.color.set( 0xffffff * Math.random() );


} );

This will set a random color to the different materials which makes it easier to see how the asset is composed.


Thank you so much for the reply, but my question is how can I change the mesh color during runtime?

Well, you can use the same code if you want to change to color during animation.