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 uv · Apr 12, 2013 at 12:41 AM · dragswipeselectgesture

Swipe Drag Select Gameobjects :( ?

http://www.youtube.com/watch?feature=player_detailpage&v=Pns5fW-92B0#t=70s

Like in the game-video posted above ... how can I drag my finger from one gameobject to other gameobjects and detect where I went and what I collided with. Basically I am trying to check if the player swipe pattern was what I wanted...if the player selects(drags\swipes finger) gameobject in a particular manner ...select A ,then select C and then select B ... then do something {} ...hope my question made sense its 6 am and I am still trying to put thoughts to logic :( ..help appreciated

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by robertbu · Apr 12, 2013 at 01:34 AM

Assuming your buttons are 3D game object in world space, you can approach this problem in one of two ways. You can use the OnMouse*() functions to capture input. For example put the following function in a script and attach it to an object:

 function OnMouseEnter() {
     Debug.Log("Entering");
 }

With this method, each individual object would be responsible for reporting its own input to some central script.

Another way is to use Physics.Raycast(). Using this method, your detection code will centrally located. Google "Unity3d Physics.Raycast" and you will find 1000s of posts on this site, most including some source code to study. With this method, your tiles will need to somehow uniquely identify each tile value. You can do this by using the GameObject.name, or you could attach a script to each tile and have a global variable you set. This variable would be read by the script that does the Raycasting.

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 uv · Apr 12, 2013 at 06:30 AM 0
Share

Thanks robertBu will try mouseEnter and get back

avatar image Bunny83 · Apr 12, 2013 at 08:02 AM 0
Share

@uv: Don't post comments as answers. Use the "add new comment" button below a post. Answers should answer the question.

I've converted your answer to a comment.

ps.: dont't forget to tick an answer as solution when your problem is solved. Also upvote answers that has been useful.

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

11 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

Related Questions

Is there an Editor Window "IsSelected" equivalent for popup windows? 2 Answers

Swipe Movement On A Grid 1 Answer

Swipe & gesture controls for android 1 Answer

Character Dress Up 0 Answers

How to continuously make the player travel a certain amount of distance based on the drag speed on screen (just like on trackpads on laptops) 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