- Home /
Don't write code to spec.
how do I put different color on cubes that are spawning?
I am making a game like bejeweled and i need to put different colors on the cubes that are falling. also I need to spawn cubes in rows like 5x5 or so and I don't know where to start. I am not the best at scripting and using unity but please help.
This is essentially the same question I closed a little while ago, plus you put two technical issues in the same question. I know it is frustrating having questions closed, but you need to take some time to research your questions and make scripting attemps on your own. Putting cubes down in a 5x5 grid uses a nested for loop. Google "nested for loop example." You will find many hits. Some will be in other languages, but the syntax will be very similar. Add the keyword 'unity' to the search and you can likely find code to borrow. As for changing color, this question has been answered hundereds of times. Google "unity3d change color of object."