Answer the question
In order to leave comments, you need to log in
How to randomly change graphics in Unity?
How can I change the color of the game objects every time the level is restarted?
That is, let's say there is a red square, a red platform, etc. with configured physics, scripts, etc., is it possible to make sprites (namely sprites, not prefabs) with a green square and platform be loaded instead of red ones when restarting the level?
PS Another question: can inspector be copied from one object to another?
Answer the question
In order to leave comments, you need to log in
There are several implementation options:
If your objects are difficult to set up, and differ only in color, then it is better to go the second way. You can change the color in many ways: replace the sprite or color in the SpriteRenderer , hang different materials, twist the color in the shader, etc. The task is to get a reference to the object being changed in the control script and replace the desired variable.
PS Right click on the head of the component, copy
Click on the component on another object, paste
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question