Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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
1
Question by SamaelSavage · Apr 07, 2016 at 07:00 PM · androidswipebutton trigger eventsmultitouch

How do i press multiple buttons at once in a single swipe

Hello,

I'm working on a lite piano android game trying to learn how to use unity, and i'm trying to make it so that i can press all of the keys in a single swipe of the screen, while having all of the keys animate as if they're being pressed.

I've currently got a setup of 8 buttons in a line, all of them using OnPointerDown to play an AudioSource when i tap on any of the buttons, and OnPointerEnter to play all of the sounds when i swipe across the buttons. The problem with the solution i'm using is that if i start my dragging motion from any of the buttons, the first one pressed will remain pressed down and the rest of them will not get highlighted. If instead i start the dragging motion from above the buttons, they all get highlighted accordingly.

Any hints for this? I've been searching for a few hours.

Thanks!

Comment
Add comment · Show 2
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 SamaelSavage · Apr 07, 2016 at 07:56 PM 0
Share

As an update, i've figured that i can: Set all of the button state colors to white, then set the CanvasRender.SetAlpha to 0.8 and thus get the "pressed" effect while sliding over, sounds and everything.

The only problem left now is that the first button pressed still remains with a set alpha of 0.8 upon moving the Pointer outside of the button boundary, as long as the finger is held down.

avatar image 5c4r3cr0w · Apr 08, 2016 at 04:55 AM 0
Share

When you apply input use Raycast to detect the button and continue that when you're dragging. You'll be able to get the all button being pressed when you apply input as you're detecting it when you're swiping.

If you don't know how Raycast works , check this out:

http://docs.unity3d.com/ScriptReference/Physics.Raycast.html

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Multi touch support for Android devices 0 Answers

Two player touch screen 1 Answer

Swipe and Joystick Together on Mobile 0 Answers

Do On swipe finger? 1 Answer

Android wear swipe to dismiss 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