Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Clint.Carpenter · Oct 08, 2015 at 01:44 AM · uiinputloadlevel

Clear presses from previous scene

In my first scene I have a button that causes the second scene to load. The second scene has a button in the same location. If the user is over eager (or the delay loading the second scene is over long) they might press the button multiple times while the scene is loading. As soon as the new scene finishes loading those button presses come through, but since it is a new (different) button the result is lousy.

Can I clear pending inputs when I load the new scene?

Is there another trick to prevent this behavior?

Thank you in advance for your help!

Comment
Add comment · Show 1
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 Glurth · Oct 08, 2015 at 07:34 AM 0
Share

Hmm, what happens If you start the scene with the buttons inactive, then, once the scene is loaded, activate them? Or perhaps a similar trick with the UI layer?

4 Replies

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

Answer by Miizu · Oct 08, 2015 at 10:42 AM

I think you could easily fix this by just setting the button's interactable variable to false the first time they press it.

.edit
I think I understood your question incorrectly, if the problem is in the second scene, create a script that sets the same variable to true after some seconds, this way when the scene is still loading the button would not be interactable.

Comment
Add comment · Show 1 · 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
avatar image Clint.Carpenter · Oct 08, 2015 at 05:52 PM 0
Share

Thank you everyone for the great suggestions.

I ended up implementing a combination of suggestions from here. 1) On the second scene I start with the button not interactable and only set interactable to true after the scene is done loading. This seems to resolve any left over presses from before scene was loaded.

2) I also added a transition in between the two scenes. The transition starts immediately after the first button press so the user should get the feedback that something is happening and not feel a need to press the button again (even if there is a slight hiccup latter as it is loading the second scene)

avatar image
1

Answer by HarshadK · Oct 08, 2015 at 08:30 AM

One option I would like to suggest is that once user presses the button to load the second scene then disable that button or remove it altogether from the screen so that user will not be able to press it multiple times. This will clear out the problem of user trying to press the load button multiple times. It is a very standard trick used in the websites to prevent form submissions multiple times by users since user might feel that the website is not responding or like that.

To add to it once user presses the load button and you hide or disable it, you can show a message to the user that second scene is being loaded to let them know that their input is received and system is processing it.

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
avatar image
0

Answer by NDark · Oct 08, 2015 at 10:14 AM

How about try adding a state of "not press" or a timer after loading scene after before load another new scene?

If I were you, I will try these solutions...

  1. There must be non-press state first of this trigger

  2. After a loading scene action, there must be 1 sec duration, then able to trigger.

  3. Use GUI Animation, everytime new scene loaded, the GUI will animate from outside of screen, make sure the user will not press the same button again.

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
avatar image
0

Answer by SmileQ · Oct 08, 2015 at 07:14 AM

Dont know why this would happen.

But the first fix that came to mind was to set a one second delay after scene load before you can press the button. Or maybe less ,1/4 of a sec, just play with it.

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.

Follow this Question

Answers Answers and Comments

41 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

Related Questions

Add different input for On Click event (UI) 0 Answers

Cannot jump like GetButtonDown with UI button 0 Answers

Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers

EventSystem not detecting all UI elements 1 Answer

OVRInput keys are not working 0 Answers


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