I have my game set up in 2D mode, There is a side scrolling camera with a bar that follows it, during the game bricks will move across the screen, when they disappear off screen I am trying to get them to collide with the bar following and the move back by an x value of Random.Range(-6,-8) I am unaware if my code is wrong, or if I have an error, but I will post what code I have used.
function OnCollisionEnter(collision:Collision){
collision.transform.position = Vector3(Random.Range(-6,-8), Random.Range(-3,6),0);
}