Can't change material's color through code

having some builtin colors like in Unity would probably be useful tho. Btw on a tangent: we also have a bunch of Gizmo functions that are super useful for testing and debugging your threejs scene :slightly_smiling_face:

I want to create something unanimous for all interatable objects :slightly_smiling_face:
surely material changing isn’t the way to go but ill change it when it works :wink:

by user 198447544408342528

I see I see :slightly_smiling_face:

Thank you for a fast fix :pray:

by user 198447544408342528

That worked! Thanks so much :slightly_smiling_face:

by user 198447544408342528

Do you reckon there’s in this forum there’s an answer that is applicable for Needle engine?
Specifically monotoan’s answer (MaterialPropertyBlock) or metalvblue (Instantiate new Material)

link: Change the color of a material for only one object - Questions & Answers - Unity Discussions

by user 198447544408342528

This doesnt exist in threejs directly but maybe it will be available or easier to make possible with wbgpu at a later point (browser support isnt great yet, specifically safari where we don’t know when support will come). Mugen suggests to create multiple materials since the shader will still be re-used under the hood but I think in Unity it’s also used to batch draw calls together automatically and I think three.js doesnt do that out of the box.

ok so i have to make multiple materials, got it :slightly_smiling_face: Thanks!

by user 198447544408342528

Yes :slightly_smiling_face: sorry for the lenghty answer^^

You are great and so helpful! I am happy to learn and dive deeper and deeper into this amazing world of ThreeJS and the Needle integration :slightly_smiling_face:

by user 198447544408342528