Game Over

hi little funny people…:smile::smile:
I’m looking for a gameover script…
can anyone help me???

That is a very general question, so here is a very general answer.

Application.Quit();

what is the game you’re making? Can we have a link? Cuz if you’re looking for GameOver script I presume you’ve already found the rest :smile::smile::smile::smile::smile::smile::smile:

sorry for my humour :slight_smile:

I want to know what translator you used converted something into that, lol.

Google Translator?

I use it sometimes, never gone to english school or things like, games taught everything i know about english lenguage,

english lenguage eh?

where can I get the aplication.quit() script

I actually really did just /facepalm at that without realizing I was doing it, lol.

Anyway http://unity3d.com/support/documentation/ScriptReference/index.html

or more specifically

http://unity3d.com/support/documentation/ScriptReference/Application.Quit.html

You have to create the script and use it in that, but IMO it’s not exactly useful for a gameover as it will simply quit the application. What you’re really looking for is to make a scene which occurs when your player dies or loses all his lives, which would be loaded if an event like that occurred.

me either =DDDDD

thanks Frank Oz

where I put Application.Quit();

Up the code

if(timeToQuitIsNow) Application.Quit();

in which script i put application.quit();

Thanks MrDude!

You put the Application.Quit() in whatever script you have that calculates when the game ends.

If the game ends after the character has collected, say, twelve bananas, then you would put it in the script that tracks bananas, such as:

var bananas:int;

Update(){
    if(bananas == 12){
        Application.Quit();
    }
}

You are kidding, right. None of us know what you are working on. Whatever controls your game. Whatever controls time in your game… That is where you put that script.

You are lacking the concept that these scripts can be put virtually anywhere.

My suggestion… make an empty GameObject and call it GameController. Make a script, call it GameController. Attach that script to the GameController Script. In that script, put everything to do with starting, and stopping your game.

Also, you can put any major controls in that script. So if you pressed Escape, and you wanted a menu to pop up, that script controls that. It doesnt have to control the menu or GUI but it should be the core place that you put that kind of stuff.

It will make alot more sense that way, then a bunch of scripts in a folder.

i am making a health script, and I am looking for a game over script, for when my character finished his lives, the game over, BigMisterB .

Petaflops, no offense but juding by the numerous amounts of threads you’ve posted and their content, I really believe you should start looking into basic programming before jumping straight at your game. There’s an enormous amount of tutorials and guides to learn programming on the internet, google can help you find most of them.

These forums are for helping you, not creating your game for you.

AHHH… a state… you didn’t write that before.

if(lives == 0){Application.Quit();}

// what would be better..

if(lives == 0)Application.LoadLevel("GameOver");

I totally agree with Myx, you need to start learning programming in general before starting a game. Specifically Object Oriented Programming. as that is what Unity is.