What i’m trying to achieve is to make 3 cubes to randomly change on their positions. I was having problem with how to change different textures randomly on a cube but solved it. For example i have red, green and blue cube at static positions. How to make them randomly change their positions? Thank you.
Well, it depends a little on where you want your cubes to end up. For example, if you want them to be placed within an axis-aligned box, you can use:
transform.position = new Vector3(Random.Range(minX, maxX),
Random.Range(minY, maxY), Random.Range(minZ, maxZ);
Where min(X|Y|Z) and max(X|Y|Z) are the extents of the box. If you want to constrain them within a sphere, you can use Random.insideUnitSphere. (See the Random class documentation for more examples)
Keep in mind that this does not ensure that the cubes do not overlap, as that is a more challenging problem.