• 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 Galatia410 · Apr 22, 2017 at 07:25 AM · buttonscenescene-loadingdebugload scene

buttons not being able to be clicked?

I was about to publish my game, went to resize my joystick for scene 2, finished, went back to make sure it worked.... On the preloader scene(0) It wont let me click the button to go to the next scene if google services doesnt connect. (FailedStillPlay= my nonworking button) there is no debug log appearing either although there should be if the button is pressed. and also no errors in console. I went and tried to load scene 1 manually and im having the same issue with the "Start game button". ive tried removing scripts from game objects, reassigning the buttons... nothing, still cant click them. Its not all of them though my options button on scene 1 worked. so looks to be the buttons that use scenemanager? but its not even making it to the call for a new scene. Im royally confused. If anyone can take a look at this and help it would be much appreciated. thank you in advance.

EDIT: So after more looking... like a moron i stole my main menu when making the preloader. when i was doing touch-up like i stated earlier I went to make it a prefab and accidentally overwrote my main menu(scene 1) I've remedied the issues with scene 1 now, it works great and the menu is back to normal. however this doesn't really help as i still cant get past my preloader....? so just to clarify. My Only issues are with Scene 0, my preloader.

EDIT2: I added a debug.log to my update method. It still keeps logging that its happening even when i cant press my start game button. I should probably add that i cant press my exit button either, yet again doesn't show the debug message that its been pressed.

EDIT3: I successfully bypassed the button by sending my script there directly. it worked great.... but that doesn't really help as I still need to be able to click the button for the message and a pause, or else the user doesn't know they failed to connect to google and are playing offline. With this edit I'm officially out of ideas as to how to debug or fix this... Maybe start over but lol would rather not...

     else if (seconds > 15 && !Failed) {
         LoadingImage.SetActive (false);
         LoadingText.SetActive (false);
         FailedConnectButton.SetActive (true);
         Failed = true;
         Debug.Log ("Failed should be true, Failed="+Failed);
         FailedStillPlay ();
     }

Code for Preloader:

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement;

public class PreloaderScript : MonoBehaviour {

 public GameObject FailedConnectButton;
 public GameObject LoadingImage;
 public GameObject LoadingText;
 bool Failed = false;
 public int Scene;
 GameObject GPServices;
 float seconds = 0;

 void Start () {
     Scene = SceneManager.GetActiveScene().buildIndex;
     GPServices = GameObject.Find ("GooglePlayServices");
     LoadingImage.SetActive (true);
     LoadingText.SetActive (true);
     FailedConnectButton.SetActive (false);
 }

 void Update () {
     if (GPServices.GetComponent<GPServices> ().ConnectedGooglePlayServices) {
         Debug.Log ("Connected to google successfully, Failed should be false, Failed="+Failed);
         SceneManager.LoadScene(1);
     }

     seconds += Time.deltaTime;
     if (seconds <= 15) {
         LoadingImage.transform.Rotate(0,0,-200*Time.deltaTime);
     }
     else if (seconds > 15 && !Failed) {
         LoadingImage.SetActive (false);
         LoadingText.SetActive (false);
         FailedConnectButton.SetActive (true);
         Failed = true;
         Debug.Log ("Failed should be true, Failed="+Failed);
     }
 }

 public void FailedStillPlay (){
     Debug.Log ("connect button pressed");
     SceneManager.LoadScene (1);
 }

 public void Exit(){
     Debug.Log ("exit button pressed");
     Application.Quit ();
 }

}

alt text

untitled.png (127.2 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Galatia410 · Apr 23, 2017 at 06:25 PM

lol since nobody answered this, I'm going to in case anyone has a similar issue and finds this. So after troubleshooting everything i could for almost 2 days... Its a simple problem. I forgot to put an "EventSystem" in so my buttons were not working, lol apparently they need one :)

Comment
Add comment · Share
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

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

83 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 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 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 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

Loading Muiltiple Scenes Async 0 Answers

Particular scene loads fine in the Unity Editor, but unable to load in the executable? 0 Answers

Using UI.Button to Load Another Scene? (using outdated tutorial video) 1 Answer

Button to new scene 3 Answers

Why is OnLevelWasLoaded () called twice and why are my variable's values different in each call?,How do I use a variable right after scene change? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges