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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by aikitect · Dec 29, 2012 at 03:55 AM · mobiledragslingshot

How do I drag a 3D object as if it were in a slingshot (touch-based)?

I would like to design a slingshot that is similar to the following demonstration: http://www.youtube.com/watch?v=TNCkxEqwEK0

However, there are a few major differences:

  1. This would be on a touch-enabled device on iOS or Android.

  2. Dragging down would actually bring the object closer to you.

  3. Creating a dead-zone above the object to prevent you from dragging up.

I am a beginner and am first trying to figure out how to drag the object so that the following behaviors occur:

  • Drag left/right - The object moves to the left/right.

  • Drag down/up - The object moves closer towards/farther away from you.

Can someone show me a quick example of how I would implement something like this?

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
0
Best Answer

Answer by pako · Dec 29, 2012 at 11:18 AM

I can't provide you with a quick example but I'll try to point you in the right direction.

There are 3 main elements to what you want to do:

  1. The touch screen interface

  2. The rendering of the sling shot (GUI)

  3. The physics logic

Especially since you are a beginner, I would advise that you check out the asset store for available solutions.

My personal favorites are Virtual Controls Suite (VCS) for touch screen, and NGUI for GUI.

For the physics logic: Unity Physics engine would do most of the work as long as you attach a Rigidbody component to the sphere game object, or whatever other object you want to shoot with your sling shot.

EDIT: If you want the sling shot to move on the z-axis then it would need to be created in a 3d modelling package (e.g. Blender).

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

9 People are following this question.

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

Related Questions

Dragging UI Image by touch 3 Answers

Drag camera: Translate and DeltaPosition: move object a little further at end [ANDROID] 0 Answers

how i can make smooth rotation for mobile game? 1 Answer

How Can I Drag the Object With Touch ? (Mobile) 4 Answers

Unity mobile swipe drag control 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