- Home /
Picking up few different objects
Hello :)! I wanted to make a simple game, when on the floor there are few fields colored differently (i just made a terrain out of cubes and colored 8 of them) and i have 8 cubes to pick up, move and put on the field of the same color as cube - that is how i win the game.
Now, my thoughts about it were to check if the tags (names of colors) of the cube and the field that are touching are the same and show the information about it on the screen, when all 8 field-cube pairs are matched, finish the game. If you have better ideas on how this could be solved they will be much appreciated.
But now I met the wall. If 8 cubes have different tags, do i have to write the picking up script for all 8 of them or is there a way to somehow handle them all together in one script (i thought about just using ".tag==color1||.tag==color2|| etc., but it is not too elegant, just wondering if there is a better way to do it)?
maybe give the cubes a color (string) property and the places -where they should be- too. and you can pick up any cube take to any of the places and compare their color property. So you don't have to use tags.