Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 LiquidStorm · Jul 06, 2015 at 01:21 PM · buttonclick

Button waits 3 clicks before working

Hi,

I have quite a problem here: I created a button "Menu" thats works like a dropdown. Basically, it makes a panel with icons appear/disappear (with Gameobject.SetActive()).

Here is the script for the dropdown menu. I attached it to the event OnClick().

 using UnityEngine;
 using UnityEngine.UI;
 using System.Collections;
 
 public class Drop_Down_Menu : MonoBehaviour
 {
     public GameObject panel;
 
     private bool isActive;
 
     public void Start ()
     {
         isActive = false;
         panel.SetActive (false);
     }
 
     public void DropDown (GameObject panel)
     {
         if (isActive) {
             panel.SetActive (false);
             isActive = false;
         } else if (!isActive) {
             panel.SetActive (true);
             isActive = true;
         }
 
     }
 }


It seems to work quite well, except that I have to wait the 3rd click for it to activate and actually make my panel visible. I'm sure I've seen a topic like this in the forum, but I can't find it anymore.

Did anyone have the same problem before?

Thanks for your help!

Comment
Add comment · Show 4
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 LiquidStorm · Jul 06, 2015 at 01:01 PM 0
Share

I've got more information for you! After test, it seems that the problem occurs only on one scene. The one with an AR Camera (using the Vuforia SD$$anonymous$$ for Unity). On the other scenes without this camera the button works perfectly well. I'm working on it, but still have no idea...

avatar image Umresh · Jul 06, 2015 at 01:46 PM 0
Share

Check if you are using Screen Space : Camera , if so change it to screenspace : overlay

avatar image LiquidStorm · Jul 06, 2015 at 01:59 PM 0
Share

Screen Space - Overlay was already activated.

avatar image LiquidStorm · Jul 06, 2015 at 02:46 PM 0
Share

Problem solved. I had the script attached also to another object, which created some confusion in the app. Thanks for the help anyway!

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

android and ios - phantom UGUI Button click when loading new scene w/ finger already down 1 Answer

Trigger a Button Click 2 Answers

Simulate a mouse Click? 2 Answers

gui.button down 2 Answers

how would i create a button that animates the main camera when clicked? 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