I was doing the 1st Lab of Walker’s Boys training session.
What I am trying to do is randomize 3 cubes in front of camera without collided with other by OnTrigger/OnCollision functions
The problem is the event does not trigger if those cubes didn’t move after instantiate or move(It’s work just fine when a cube fall on another cube)
Is that how it support to be, or I missed something? Here the code:
function move(){
var position :Vector3;
position.z= 9;
position.x= Random.Range(-0.7,1.7);
position.y= Random.Range(13.2,15.2);
this.transform.position=position;
}
function OnCollisionStay(other:Collision){
Debug.Log("Triggered");
this.move();
}