My question is, how to make three cubes randomly change on three STATIC locations. Or three different shapes, to change only on three static places. I have it made the textures to change but that’s not what I need. For example, three cubes with different colors swap on three defined positions. Thank you.
So you just want to change the position of the cubes? Well, you could have a array that contains the coordinates of those 3 places or just a array of empty game objects that are placed where you want.
Something like…
var ar = new Array();
ar[0] = emptyGameObject_1;
ar[0] = emptyGameObject_2;
ar[0] = emptyGameObject_3;
an whenever you want to change the position of a cube just do something like…
Sorry for the very late reply. I tried it somehow modifying it but didn’t work.
I realize that it should be in an array, just like you said, but it also must be so that the swapped locations are always different. What if two or three cubes go to one same location? That’s what I wanted to ask I got lost there.
Tried it and it gives me several same errors: - error CS0116: A namespace can only contain types and namespace declarations - it gives this error to these lines
public GameObject[] cubes;
public Vector3[] pos;
public bool swap;
and also a Parsing error on the end of void SwapCubes.
Hey, how do you copy the script? Because it needs to import the namespaces and to be inserted in the class, if you can wait when I go to home I can make it in unity so I can give you all the script…