Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 RaphDuBus · Apr 08, 2011 at 01:26 PM · iosinputiphoneiphoneinput

ios pinch/tap/swipe/pan/(...) gesture

Is there a way, or script that can help distinguish finger gesture on iOS

For exemple, how to make the diffrence between a simple tap, a swipe, a pinch... ?

a kind of equivalent to the "UIGestureRecognizer class" for Ios (http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIGestureRecognizer_Class/Reference/Reference.html#//apple_ref/occ/cl/UIGestureRecognizer)

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 Jean-Fabre · Apr 08, 2011 at 02:09 PM 0
Share

Hopefully the asset store will soon see some tools to do this :)

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Justin Warner · Apr 08, 2011 at 01:27 PM

http://forum.unity3d.com/threads/76302-Pinch-Gesture-for-iOS-(v3.0)

Google before posting.

Thanks =).

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 RaphDuBus · Apr 08, 2011 at 01:38 PM 0
Share

Thanks justin for answering.

I have ask this question because i have already google it, and search in forums... with no sucess. I had also already seen the link you give, but it does not answer my concerns.

avatar image Justin Warner · Apr 08, 2011 at 01:42 PM 0
Share

Well, if you read it, it says you do have to code it yourself, and I don't think it's been done, as many people using Unity, use it to make game... Not so much apps... But maybe someone can help you further.

avatar image
1

Answer by hedgie · May 11, 2012 at 12:26 PM

I use the following code. It works but i guess there are better ways to do it.

 float pinchLength = 0f;
 void Update(){
   if(Input.touchCount == 2 && Input.GetTouch(1).phase == TouchPhase.Began){
     pinchLength = Vector2.Distance(Input.GetTouch(0).position, Input.GetTouch(1).position);
   }
   if(Input.touchCount == 2 && (Input.GetTouch(0).phase == TouchPhase.Moved || Input.GetTouch(1).phase == TouchPhase.Moved)){
     float deltaLength = Vector2.Distance(Input.GetTouch(0).position, Input.GetTouch(1).position);
     Game.cameraManager.ZoomBy(Mathf.Clamp(1f/pinchLength*(deltaLength),-1.5f,1.5f)); // ZoomBy(float Zoomfactor between -1.5x and +1.5x), eg orthographicSize
     pinchLength = Vector2.Distance(Input.GetTouch(0).position, Input.GetTouch(1).position);
   }
 }
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 DaveA · Apr 08, 2011 at 04:05 PM

There's a swipe utility in the Asset Store. I've not tried it myself yet, but it's nicely priced.

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 Spk · Jul 09, 2011 at 12:21 AM

You might be interested in checking out the FingerGestures scripting package from the Asset store. This is pretty much what you're after. You can get more information in the forum thread at http://forum.unity3d.com/threads/95983-FingerGestures-Robust-input-gestures-at-your-fingertips!

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

2 People are following this question.

avatar image avatar image

Related Questions

Missing documentation - iphoneinput class 1 Answer

How to set up virtual D-Pad for iOS? 1 Answer

Detect a tap versus standing touch on iPhone? 3 Answers

Detecting touches in a Rect on iOS 2 Answers

which TextureFormat should I use for new Texture2D on iphone 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