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”);
}