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 matta9001 · Jul 26, 2015 at 01:41 AM · c#mobiletouchprime31

Prime 31 Touch Kit detecting if touch hit gui element

I installed the Prime 31 Touch Kit and its good, and i want to use it to pan my camera and look around. My problem is, when i touch some of the movement buttons(that i put on a canvas), prime 31 detects this. Is there any way that the script can ignore when i touch an element such as a button? I don't know where else to ask questions about this kit I thought this would be the best place.

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 getyour411 · Jul 26, 2015 at 04:47 AM 0
Share

what is 'the script'

avatar image matta9001 · Jul 26, 2015 at 04:50 AM 0
Share

It is this addon https://github.com/prime31/Touch$$anonymous$$it "the script" might have been the wrong wording but I tried searching the internet for help on how to use this but I didn't see too much support so i thought mabye someone here knew how to use it.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by bojangles · Oct 27, 2015 at 07:46 PM

Use: EventSystem.current.IsPointerOverGameObject()

E.g.:

 // This is on the camera object, and moves the projection camera up / down based on the pinch
 // ONLY if it is not over an object within the EventSystem
 private void PinchRecognizer_gestureRecognizedEvent(TKPinchRecognizer obj) {
   if (!EventSystem.current.IsPointerOverGameObject()) {
       float y = Mathf.Clamp(transform.position.y + (transform.position.y * obj.deltaScale), 5, 15);
       transform.position = new Vector3(transform.position.x, y, transform.position.z);
     }
 }
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 Noway255 · Apr 06, 2017 at 02:05 PM 0
Share

Hey,

Somehow this method will only depend on where you cursor is at the moment you query this method.

Let's assume you started pressing a button, and while holding your cursor you moved out of the button bounding box, this method will return false. How can you handle this case? I still want to prevent gestures because the user might actually get his cursor back on the button to validate the press.

Best regards

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

23 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

Related Questions

Distribute terrain in zones 3 Answers

Unity3d Get Cube Pressed On Mobile 1 Answer

Detect swipe up gesture IOS 1 Answer

Android 2D multitouch joystick + buttons 0 Answers

Turning touch to rotation 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