Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Felipetnh · Aug 06, 2012 at 02:46 PM · loadlevelapplication

Weird behaviour in Application.LoadLevel()

Hi. I'm creating a tetris-like game for my boss, and I'm experiencing an weird behaviour.

In my game I have two scenes only. The first scene is the menu, and the second is the game itself.

When I first open the game (editor, android or iOS), it loads all the menu. When I go to the game, it loads the game. But in the game scene I have a button to go back to the menu. And that's the weird part.

I press the button and the game takes about 5 seconds to show the menu, but I can press the buttons in the menu, even when the menu is not visible. For example: the button to go back to the menu is in the same position as the button to go to the game. So if I double press the "go back button", the game loads the menu, and loads the game again. (because the second time I pressed the button, I did press the button to go the game)

Anyone have any thoughts? (did I make myself clear? English is not my main language... xD)

[EDIT] I forgot to say, but in the menu scene, EVERYTHING visible comes from the OnGUI function, except the background, which are several plans with the same texture. And I have one function that gets the resolution and force the camera to be in 3:4 aspect ratio.

[EDIT 2]

The menu button is:

 // Start Game
 if( GUI.Button(Rect(playGameX,playGameY,larguraBotao,alturaBotao),"",playGameStyle) ){
     Application.LoadLevel("Game");
 }

And the button that goes back to the menu is:

 if( GUI.Button( Rect(yesX,yesY,larguraNoYes,alturaNoYes),"",yesStyle ) ){
      Application.LoadLevel("Menu");
 }
Comment
Add comment · Show 10
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Seth-Bergman · Aug 06, 2012 at 02:49 PM 0
Share

we need the code

try posting the relevant part

avatar image Felipetnh · Aug 06, 2012 at 02:52 PM 0
Share

I edited my first post with the code of both buttons.

avatar image Seth-Bergman · Aug 06, 2012 at 03:05 PM 0
Share

well no problem there...

maybe the camera script is the issue...

avatar image Felipetnh · Aug 06, 2012 at 03:06 PM 0
Share

The script of the aspect ratio?

avatar image Seth-Bergman · Aug 06, 2012 at 03:10 PM 0
Share

hard to say, not much to go on here.. what are you seeing during those 5 seconds?

still the game scene?

Show more comments

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Application.Loadlevel("Level Name"); not working on android 2 Answers

Application.LoadLevel() doesn't clear screen 1 Answer

How to create a complicated game over scene ? Help 1 Answer

Teleporting/application.loadlevel 1 Answer

Play Scene help 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges