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
7
Question by A Lee · Jun 04, 2010 at 02:43 AM · gameobjectiphonetouch

Drag-and-Drop GameObjects

Hello, I am looking for a way to drag and drop GameObjects around the screen using the screen touch on the iPhone / iPod Touch / iPad. Currently, I am using a GUI Button to instantiate the object into the world, and now I would like the player to be able to drag each object around by pressing on top of it, and then sliding their finger on the screen. Can you please point me in the right direction?

Thanks

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 sriram90 · May 30, 2012 at 07:05 AM 0
Share

Hi am too struggling here. i need to do the same what you actually asked here. player should able to drag on image, and then sliding by finger, and need to place a 3d object in screen.

if you done with your work, can you help or show me right way to do this?

5 Replies

· Add your reply
  • Sort: 
avatar image
6

Answer by crevelop · Aug 18, 2011 at 10:38 PM

I've made few tutorials on dragging and rotating an object by touch(Unity iOS), just wanna share them.

These are the Youtube videos:

Dragging http://youtu.be/QjUhQ4z6pF0

Rotating http://youtu.be/oOfPMKdJdKk

Get the source code from my website:

http://www.revelopment.co.uk

Hope it helps.

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
1

Answer by Murcho · Jun 04, 2010 at 03:32 AM

There's a good script on the wiki to just that. Should at least give you a good research starting point. Script link here.

Note this is for use with a mouse, however converting to use iPhone input shouldn't be too difficult.

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 persijn · Oct 25, 2015 at 01:49 PM 0
Share

Link is down?

avatar image ocimum · Dec 29, 2015 at 11:49 AM 0
Share

@persijn use search engines http://wiki.unity3d.com/index.php/DragObject

avatar image
0

Answer by Philip 1 · Jun 04, 2010 at 03:43 AM

I thought you may create one position when you click on the screen then using camera position and "finger" position to made a raycast

this raycast will trigger the object you want to drag when you leave finger away ,the gameobject will be dropped as soon as the raycasthit function ended

now the drag function using fixupdate() to adjust the coordinator of the gameobject by detecting the coordinator of your finger

last but not least,when you try to drag those things with physics effect please add rigibody and collision on that gameobject too

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 · Aug 08, 2012 at 11:16 PM

FingerGestures has a bunch of toolbox scripts (TBInputManager + TBDrag) to take care of object-dragging for you. You may want to give it a look!

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 Aarlangdi · Nov 27, 2013 at 06:25 AM

Check this out this might help you guys -- http://aarlangdi.blogspot.com.au

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to get TouchPosition ?? 1 Answer

Touch Drag GameObject Found 1 Answer

Continuous shooting by holding iPhone button 2 Answers

Inaccuracy in iPhone touch? 0 Answers

Touch To Move iPhone 3 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