I am trying to re-start the game with a keypress by using Application.LoadLevel(0) but, after the game re-starts, the object I usually move forward with the “w” key no long responds to the “w” key to move forward. So my question is: are there any differences between the actual first time loading the level and loading level 0 in the middle of a game? Put another way, is there a way to make it so that re-starting by loading level 0 will be different from the original start or is that impossible?
Thanks!
There have to be some other problem with your game. A scene (Level) shoud be working the same way, doesn't matter if you load it once or 100 times.
– instruct9rIf you use static variables, they will not be reset.
– whydoidoitCorrect :). But if you plan to use it in that scene only, then you'll be setting it's initial value in the awake or start functions, which will reset them. :)
– instruct9r@instruct9r: If there is another problem, I'm interested in what it could possibly be because I would've thought a LoadLevel would reset everything so as to be exactly the same as if the game were initialized for the first time. @whydoidoit: That's a good reason - the static variables could make a difference! @instruct9r: I only have the one scene which I'm reloading and it does not seem that the static variable is reset when I do a LoadLevel("TheScene")
– shakeyThey aren't reset unless you explicitly reset them in Awake or Start.
– whydoidoit