Ok so for a college assignment I’m making a game with a carnival theme, its for a education game. Its going to be a set of mini-games and one of the mini-games is that when you go up to a stall a game will start that asks you a maths question and their will be 4 boxes on a shelf and you have to pick the right answer that will be on them.
Now what I’m looking for is that the boxes with the answers don’t stay in the same position all the time, that they swap around with each other, I have this code at the moment but it ain’t working.
public var objects : Transform[ ];
public var maxPos : Vector3 = Vector3.zero;
public var minPos : Vector3 = Vector3.zero;
function Start()
{
for(var obj : Transform in objects)
{
var newPos : Vector3 = new Vector3(Random.Range(minPos.x,maxPos.x),
Random.Range(minPos.y,maxPos.y),
Random.Range(minPos.z,maxPos.z));
obj.position = newPos;
}
}
So pretty much just to make sure people know what I mean here would be the stall:
1____2____3____4_ I want it that so everytime I load the scene up their in a different position such as
3____1____4____2_
Any help would be greatly appreciated.