Parenting Objects on collision?

I am using this script to parent the player to an object on collision, so the object can be used as an elevator. The script has no compile errors. any ideas about what is wrong?

var Player : Transform;
var Elevator : Transform;
function OnCollisionEnter(collision : Collision) {
	if (collision.rigidbody);
	Player.parent = Elevator;
}

Well, the most likely thing is that you have a semicolon at the end of the line with the “if” statement. This effectively makes the body of the “if” a blank statement - remove the semicolon and you should be OK (unless there is another error :wink: ).