I would like to have a different color for each instance
Asked Answered
M

4

0

I have a map where I instantiate multiple mesh spheres called "rx1" from a scene called Rx.
I have a script that assigns a random color once the instance is ready, as you can see in the image.
Nevertheless, I get the same random color for all of them, and I would like them all to have different colours.
I have activated Resource, local to scene, but disabling it does not work either.

I attach some images below.

Thanks in advance!



Majewski answered 12/1, 2023 at 13:4 Comment(0)
M
0

Solved by me. Checking and unchecking local to resource solved a problem. Seemed to be a Godot Bug.

Majewski answered 12/1, 2023 at 14:2 Comment(0)
L
0

Instances need to be made unique otherwise they share the same properties. Such as what material, what shader and so on is applied to them.

Landgrave answered 12/1, 2023 at 13:30 Comment(0)
M
0

Landgrave Thank you very much for replying. How can I set the scene instatiated by code as unique?

Majewski answered 12/1, 2023 at 13:44 Comment(0)
M
0

Solved by me. Checking and unchecking local to resource solved a problem. Seemed to be a Godot Bug.

Majewski answered 12/1, 2023 at 14:2 Comment(0)
L
0

Yep, making them local makes them unique. Not sure why it wasn't taking effect before tho.

Landgrave answered 12/1, 2023 at 20:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.