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
0
Question by Mico_Sugiarto · Oct 08, 2013 at 10:10 AM · androidtouchpattern

Pattern comparing in unity

I'm new to programming with unity and i want to make game with touch pattern feature in android game with unity..

is there any feature to compare the touch input with the background like the pict? thx

alt text

pattern.png (9.3 kB)
Comment
Add comment · Show 4
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 Hoeloe · Oct 08, 2013 at 10:16 AM 1
Share

Just so you know, you've tagged this "pattern-matching", but this actually isn't what "pattern-matching" is.

avatar image robertbu · Oct 08, 2013 at 04:59 PM 0
Share

As @hoeloe says, this is not pattern matching, and I don't know what you are asking. Are you trying to create a touch pad...map a small section of the screen to the whole screen and move an object? Note there is unlikely to be a "feature," but most problems can be solved with code.

avatar image Hoeloe · Oct 08, 2013 at 07:11 PM 0
Share

If I understand correctly, what you're looking for is something like this: http://youtu.be/Rz_-XgaWZl4?t=2m20s

There are multiple ways you can do this. The one used in this video looks to me to be one that just logs the position of the mouse every so often, and compares the distance of those positions from the source curve (the one you've drawn in grey). It will accept if all distances are below a threshold, and decline if any of them is too large.

The way I would probably do this is actually with image analysis. First, you again log discrete points of the mouse, only this time, you draw them to a texture (using linear interpolation to fill the gaps between the discrete points). Then, you take a texture containing just the source curve. You can then apply a "difference" filter to both of these curves. This filter takes 2 images, and returns a black and white image that gives the difference between the two, with black being no difference, and white being totally different. You would then combine the pixels of this difference image into one number, either by sum$$anonymous$$g, multiplying, averaging, the method is up to you. Then, you test this total difference value against a threshold, below which, you accept, and above which, you decline.

avatar image Mico_Sugiarto · Oct 09, 2013 at 05:23 AM 0
Share

sorry for the wrong tag im new in this..

@hoeloe yeah like you said im looking for something like the vid but since im new to program$$anonymous$$g i dont really know what to do..

can u show some example code? thanks again..

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by sajjadgameactor · Mar 02, 2020 at 11:10 AM

You can use this asset https://assetstore.unity.com/packages/tools/input-management/fingers-touch-gestures-for-unity-41076

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

17 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

Related Questions

Touch android iput shootting 3 Answers

GUITexture touch play animation 0 Answers

Small question about converting from Android to iOS 1 Answer

How do android touch / mouse inputs get buffered? 0 Answers

Touch Input positions are different on iOS and Android? 2 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