0 votes

So I have a character type and I want to just simply change the colors of the albedo to differentiate the characters from one another. However, when I try to change the albedo_color. It changes it for all the instanced character.

Is there a way to only change one specific instanced characters materials settings?

in Engine by (293 points)

1 Answer

0 votes
Best answer

Materials are shared resources. You need to make a new material either by duplicating the current material or creating a new material resource in a script and assigning it as the material.

var new_material = SpatialMaterial.new()
new_material.set_albedo(color)
MeshInstance.set("material/0", new_material)
by (3,223 points)
selected by

Thank you for the explaination.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.