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 xRunner · Sep 26, 2014 at 07:54 PM · mobiletouchdragtouchscreendragging

Dragging UI Image by touch

Hi. I use UI Image (from 4.6) to all my game graphic content (2D game), because it give me resolution independence (with reference resolution). I want to create dragging my character around the screen by touching on mobile device screen. I add to my character next components: BoxCollider2D, Rigidboy2D and script that i will use for dragging. I tried to follow a lot of posts from the forum, but some caused errors while others do not have any effect.

I'm really need some help in this question.

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 xRunner · Sep 27, 2014 at 07:17 AM 0
Share

Can the UI layer is used as a game (ie with rigidbody and colliders)?

Is there a way to drag UI Image?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Slava_Viper · Sep 28, 2014 at 01:39 PM

So, i can help you, but it isnt solution. In image script enable Preserve Aspect. Add to image scroll rect script. Then in content field put your image. Set movement type to unrestricted. This is bug of unity, but its works. Works so bad.

Or another more good solution. Add you image in Panel UI component.(Panel1) Panel1 must be bigger then Image. Then Panel1 add to more bigger Panel2. Add scroll rect script to Panel2. Then in content field put your Panel1. Set movement type to unrestricted.

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 xRunner · Oct 07, 2014 at 11:13 AM 0
Share

Thanks! It works :)

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Mobile touch dragging from mouse dragging 1 Answer

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

Possible to get touch area data? 1 Answer

Finger gesture works/fails on different devices? 0 Answers

Rotating a gameobject via dragging finger 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