Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 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 /
  • Help Room /
avatar image
1
Question by PeterSmith040 · Jan 24, 2016 at 03:57 PM · inputtouchdistancemobile devicesmoveposition

Get the distance of a touch while touch phase is moved

Hello,

i'm really stuck with the problem i mentioned above. I want to get the distance of the touch while the touch phase is moved and the finger is continually on the screen. The direction is redundant. The function should work like this:

while the touch phase is moved and the touch distance is > 5 do something...

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 MadDevil · Jan 25, 2016 at 05:59 AM 0
Share

You can check the it by registering two vectors. Save a vector position when the touch begins and save another vector position when the touch phase has moved. find the distance between the two vectors.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by hexagonius · Jan 25, 2016 at 07:14 AM

The touch has a deltaPosition. It's kind of a local position as if the fingers most recent position were relative to 0,0,0. the magnitude is the distance, accumulate it.

http://docs.unity3d.com/ScriptReference/Touch-deltaPosition.html

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 esfahanarvin · Dec 13, 2017 at 03:47 PM 0
Share

DUDE YOU'RE ABSOLUTELY A$$anonymous$$AZING. I've been looking for a solution for so long :')

avatar image
0

Answer by damir_2009 · Oct 22, 2021 at 01:42 PM

Hi Im kinda a beginner and I want to know how to calculate the distance when u press with 2 fingers to calculate the distance between the two fingers thanks so much

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 damir_2009 · Oct 23, 2021 at 07:45 AM 0
Share

never$$anonymous$$d i got it how to make it

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

50 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

Related Questions

I want to move my cube on right or left when I touch screen for Android devices; Please help me which script I have to use 0 Answers

Separate Input from Touch on GUI 0 Answers

Is there a way to ensure a cursor position must hover over an object to work in OnMouseDrag? 1 Answer

Input Touch(Take off finger but it's recognized as if touch was pressed.) 0 Answers

Mobile touching screen is pressing mouse 0 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