- Home /
level never loads again after quitting to the menu
So my start game button works fine, but after quitting out of the game back to the menu, it doesnt work??? this even happens when i start at the level! what is going on?
EDIT:
Each time, NO errors or ANYTHING. just doesnt load if i quitted out.
@DanSuperGP if you could just help me with this, id appreciate it, im ok with not being able to do that other answer.
Whatever you need me to tell you ill tell you. @DanSuperGP
I have no idea. You're basically saying... "$$anonymous$$y game doesn't work... tell me what's wrong"
ok well i load the game and the play button works fine, but then if i quit out and press it again, it freezes forever. even if i start in the game scene, it does the same thing as long as i was once in the game scene. @DanSuperGP
Answer by InvincibleCat · Feb 13, 2015 at 01:34 AM
So move your PlayButton anywhere else.
Change the script to this :
public void LoadLevel()
{
StartCoroutine(LoadLevelCoroutine(0.1f));
}
IEnumerator LoadLevelCoroutine(float waitingTime)
{
yield return new WaitForSeconds(waitingTime);
Application.LoadLevel("Empty Graves");
}
}
and call LoadLevel as the first method of your PlayButton (the game object)
Thanks, im going to accept this after this comment, but if you don't $$anonymous$$d me asking, what does this do differently? i know its a coroutine ins$$anonymous$$d of an invoke, but how is the outcome different?
Just made it as the coroutine because it is better:
if you decided to change the name of the method, you will have to change the string name.
Invoke is more time consum$$anonymous$$g
The thing that really changed is where to place your script. As you desactivate it, the method is never called...
Oh i get it!!! WHY didn't i see that as the issue? lmao thanks man. sometimes i need a second pair of eyes, plus I've got serious flu right now, so i don't feel too well. anyways thanks!
I will suggest that you should start with a prototype BEFORE trying to having anything like menus, $$anonymous$$imap or anything like that (event 3d models or polished stuffs). Focus on the gameplay. I started my current game with basic squared. When you will think that your game is good enough. Start polish it and improve it.
like i said, im not feeling well and its very late here. so im not thinking straight, im sorry.
Your answer
Follow this Question
Related Questions
How to make the UI invisible from behind? 0 Answers
How to stop collider from interfering with world space canvas? 1 Answer
How do I carry over ui text to the next by obtaining the gameobject children 0 Answers
Make a UI button quit the exe, Unity 5 2 Answers
How to change UI image render order dynamically on runtime 1 Answer