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 Caleb_1701 · May 09, 2016 at 11:33 PM · uibuttonmobilebutton trigger eventsmultitouch

Problem with UI buttons and MultiTouch

I am currently making a mobile game in which the character can run, jump, and shoot. Each one of them works individually, but for some reason I can't run and jump or run and shoot. I know that my device recognizes multi-touch, because earlier I created a print test to indicate how many fingers were touching the screen. It always worked correctly, but the issue now is that the UI buttons I'm using for jumping and shooting aren't working if another finger is already down. Any ideas why? I'm using an android device and Unity Remote 4, if there's a chance that has anything to do with it.

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

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by meat5000 · May 11, 2016 at 01:15 AM

I use OnDrag to measure the offset of a panel for a joystick and a simple button for shooting. Using interfaces like IPointerDownHandler etc and the StandaloneInputModule seems to support Multitouch.

Comment
Add comment · Show 4 · 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 Caleb_1701 · May 16, 2016 at 09:50 PM 0
Share

Can you explain that further? I thought the StandaloneInput$$anonymous$$odule was what I was using by default, but it isn't working for me. I can post code snippets if necessary, if the problem would be something in the code itself.

avatar image meat5000 ♦ Caleb_1701 · May 17, 2016 at 03:00 PM 0
Share

Its a slight modification of the script on this page (DragPanel)

https://unity3d.com/learn/tutorials/modules/intermediate/live-training-archive/panels-panes-windows

Implement your button using IPointerDownHandler in a script on that button. The SI$$anonymous$$odule is part of the EventSystem, which you must have for a Canvas to work at all, so I presume its there by default.

avatar image Caleb_1701 meat5000 ♦ · May 21, 2016 at 02:12 AM 0
Share

I clicked on the link and nothing showed up. Does the tutorial you are trying to link to still exist?

Show more comments
avatar image
0

Answer by Highwalker · May 10, 2016 at 05:56 AM

Personally, I wouldn't use the built in ui objects for the actual controls. You might be better off using one of the many assets out there which handle touch controls, especially if you're fairly inexperienced. My personal favorite is Control Freak.

Comment
Add comment · Show 2 · 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 Caleb_1701 · May 10, 2016 at 10:12 PM 0
Share

Thank you for the advice, but when I looked up Control Freak on the Asset Store I couldn't find a single free control set. I assume that's because there isn't one, and I really don't want to buy an asset package when what I've set up would work so well for what I'm doing if I wasn't encountering this bug. Do you have any idea how I could make it work without purchasing a pre-made asset from the Store? As I mentioned, the only problem is that the buttons aren't working when another finger is down. Everything else works.

avatar image Highwalker Caleb_1701 · May 10, 2016 at 10:41 PM 0
Share

Yeah, control freak certainly isn't the cheapest. But by far the best I've used. And the dude is great at providing support.

Here's a free one with good reviews. Though I haven't tried it.

https://www.assetstore.unity3d.com/en/#!/content/15233

I really don't know what's causing it to only accept one input. $$anonymous$$ight be a setting in the canvas or event handler, but I'm really not sure.

avatar image
0

Answer by Raimi · Jun 11, 2017 at 06:56 PM

As far as I know the UI buttons use pointer, which simulates mouse clicks. That's why you cant achieve multi-touch using the default buttons. The UI is intended for menus which usually only take 1 touch at a time.

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 ovrdb · Mar 28, 2018 at 08:22 AM 0
Share

That is not true, though it's not really clear in the docs. StandaloneInput$$anonymous$$odule handles mul$$anonymous$$ch. See: https://docs.unity3d.com/$$anonymous$$anual/script-TouchInput$$anonymous$$odule.html

avatar image
0

Answer by petanovic1234 · Jun 12, 2020 at 10:01 AM

I have the same problem Did you find solution for this problem?,Did you find solution for this??

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

66 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

Related Questions

Pls. Help how can I convert this script to be press using UI buttons. I want the vertical to be pressed and the for the horizontal I will make 2 arrows left and right. Thank you in advance 0 Answers

Button issues since Catalina 0 Answers

UI Scaling with Button Text 1 Answer

Making an object rotate towards touch 3 Answers

How to have multi-touch with Canvas buttons 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