Pong AI/Paddle controller help

Hi i'm pretty new to unity and i thought a good place to start when making games would be making Pong or so i thought there is a tutorial that helped a lot and the Ball physics script works but for some reason the Paddle controller script doesn't work. Heres the tutorial-http://www.youtube.com/watch?v=GE4scGszipY&feature=related and also if someone could help me with the paddle ai that would be great thanks

Here’s the very simplest way you can try out. This will be good for practicing pong on your own lol. Attach this to the enemy paddle. Make the paddle a rigidbody and use rigidbody constraints to allow the paddle to move only on one axis, and lock rotation. Make the ball a rigidbody, and give it the physics material “Bouncy”. Simple script, but it will get you started. I set the paddle’s Z velocity to 9/10ths of the ball’s z velocity, so you can beat the AI, but not too easily. You need to drag the ball object into the inspector after you attach this script. Or, just tag the ball with say, “ball”. Then put this in the Start() function. {ball = GameObject.FindObjectsWithTag(“ball”);} That of course is after making a variable, var ball;

var ball : Transform;

function Update()

{

rigidbody.velocity.z = ball.rigidbody.velocity.z * .9;

}

function OnCollisionEnter(collision : Collision)

{

if(collision.gameObject.tag == "ball")

{

	collision.rigidbody.velocity.x= -20;

}

}