help me to create a code of a game

i am creating a simple game.There are two gameobjects a “ball1” and a “paddle”. the ball bounces on the paddle. player have to ballance the ball. i created a scene “gameover” and i want that when ball is missing the paddle or y position of ball is less than the y position of paddle than it is the instant of game over. but in coding, i don’t know how to do it.please help me.
i just tried that code but it is not working.please help…

function end () {
if(GameObject(“ball1”).transform.position.y <= GameObject(“paddle”).transform.position.y)
{
Application.LoadLevel(“gameover”);
}

Maybe your function end is not called.

if(GameObject("ball).transform … This is not good

if your script is a component of the ball:

prefer if(transform.position.y < …

For the paddle it’s différent, you have to use get component or a static variable.

i would do this in the paddle script :

static var posy = 0.0;

function update () {
posy = transform.position.y;              

... }

Then in the ball script : (supposing your paddle script name is “paddle”)

if (transform.position.y < paddle.posy)
Application.LoadLevel(“gameover”);


when you need to acces propriety of the object and your script is a component
of the object you use no majuscule: Transform become transform !