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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by sandeepsmartest · Apr 02, 2014 at 05:12 AM · scene-loadingonguirectgui-buttonapplication.loadlevel

Gui Button Not Working After a Scene Load

Hi to all Mainly to Moderators, Erich and Andee, I dont know whats going wrong,i have a scene which consists of below code.Below scene(with the below code attached) will be loaded only when player hits the enemy.But after loading the below scene, Gui buttons are not working.I've checked by putting break point and by print statement aswell but of no use. On a special Note Below code works like Charm Only when i run the scene Separately.

 void OnGUI()
     {
         if(GUI.Button(new Rect(Screen.width*(0.01f*70f),Screen.height*(0.01f*20f),Screen.width*(0.01f*10f),Screen.height*(0.01f*10f)),"Play Again"))
         {
         print("Clicked");
             Application.LoadLevel("GameScene");
         }
 }//This code is attached to main camera and will this scene will be loaded when player hits enemy.
 //I am pretty sure that scene is loading but buttons are not working
 //above Code works only when i run the scene(with the above code attached)SEPARATELY. 

A big thanks to Unity and forum Members.

Comment
Add comment · Show 3
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 senc01a · Apr 02, 2014 at 07:48 AM 0
Share

To what gameobject (and how) are you attaching this script or behaviour? When you load the scene (not separately) and inspect the gameobject that is supposed to have this code attached, does it actually have the component you expected? Initially I do not see any reasons why this should not work.

avatar image sandeepsmartest · Apr 03, 2014 at 05:53 PM 0
Share

yes gameobject do have the above script attached...Bt a big thanks to you for ur reply..I have Solved the issue.Issue is that therz a another finger gesture reorganization script which made the above script not to work..I've solved it...Well thanks again bro senc01a

avatar image leakads · Jul 21, 2014 at 09:25 AM 0
Share

Can you please help me I am having the same problem.I am using the Daikon Forge GUI - Create Script Wizard this is the 2$$anonymous$$ tutorial: https://www.youtube.com/watch?v=06drrFD70zk. This is the code very similar to the one you used created by the Script Wizard:

public class press : $$anonymous$$onoBehaviour {

 public void OnClick( dfControl control, df$$anonymous$$ouseEventArgs mouseEvent )
 {
     // Add event handler code here
     Application.LoadLevel (1);
     Debug.Log( "Click" );
 }

}`

//$$anonymous$$y scene loads but buttons do not work and if I run the scene alone it works.Any help would be greatly appreciated. $$anonymous$$y game is a simple runner game just touch to make character jump.

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

23 People are following this question.

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

Related Questions

Help with reloading scene for endless runner 2 Answers

Why does the CardboardVR Lollygagger project crash when loading a scene on a Nexus 4? 2 Answers

UI Button Instead of OnGUI Button? 1 Answer

Return to a scene rather than loading again 1 Answer

Unknown Identifier SceneManager/Obsolete Application.LoadLevel 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