moving players after collison

Hey guys

Just working on my little sporting game simulation, I wanted to have all the players on one side of the net move to a specific position on the court after the collision between the ball and the player. This is the script I have now on the player to which the ball is colliding

function OnCollisionEnter(collision : Collision) {
 if( collision.gameObject.tag == "ball" ) 
{ 
collision.gameObject.rigidbody.angularVelocity = Vector3.zero; 
collision.gameObject.rigidbody.velocity = Vector3(-5,20,-5);  

}
}

Just a few questions

:arrow: What would be the code I would use? (I think it is the translate/transform piece of code but still a little unsure of how to use it correctly) and where would it be placed on the script?

:arrow: Would I place it along with the collision code (as it is the collision which triggers the movement) or in an entirely different script?

At the moment this is the main problem I am getting into, the plan is to have a random number generated and different actions based on the different numbers generated but at the moment that is a long way away :slight_smile:

Hey guys
Just bumping my post to see if anyone has any ideas, I have been scanning through looking for some ideas and think the translate.position is the way to go but just unsure if I can use it in the collision function I already have above? Any help would be much appreciated!

EDIT: I am currently using the idea of this thread…

http://forum.unity3d.com/viewtopic.php?t=12804

where the collision triggers a boolean value to true which is the trigger to start the movement, I just dont know how to get my characters to move to the position on the court at a constant speed! Thanks again!