I have pads in my game that are moving up and down by using a
transform.Translate(Vector3.up*Time.deltaTime*12);
now this all works fine and the pads both move up and down, and both have box colliders but for some reason if the player stands of the pad and the pad moves upwards the player falls through the pad for some unexplained reason?
Why would the collider fail? is this because the pad is moving as the colliders never usually fail?
Full Code here
private var cPos : Vector3;
var lim : float = 10;
private var change : boolean;
function Start(){
cPos = transform.position;
}
function Update () {
if (change){
transform.Translate(Vector3.up*Time.deltaTime*12);
}else{
transform.Translate(Vector3.up*Time.deltaTime*-12);
}
if (transform.position.y > (cPos.y + lim)){
change = false;
}
if (transform.position.y < cPos.y){
change = true;
}
}
The collider only fails when the object moves upwards
– AtomicMarine