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 LimboWorld · Jun 27, 2014 at 12:02 PM · inputtouchjoystickswipe

Joystick Zone + Screen-swipe touch input clash. Solution???

Hello.

I'm making a 3d third person game for android/iOS. It has a main character in the middle of the screen that is controlled by a virtual touch joystick, and the screen can be touch-swiped across the screen to make the camera orbit around the character.

This is part of my script to rotate camera by screen swipe:

 void Update()
     {
         if (target && Input.touchCount == 1 && Input.GetTouch(0).position.x > Screen.width && Input.GetTouch(0).phase == TouchPhase.Moved) //Just orbit touch without movement
         {
             Debug.Log("Orbiting! 1 touch");        
                 Orbit(Input.GetTouch(0));

meaning if I touch anywhere on the screen and drag it, it will direct to a void that would rotate camera. However, my problem is I also have a joystick at the bottom left corner of my screen, so if I touch and drag the joystick to move, it will also rotate the camera which is not what I want.

When I touch the joystick region, I do not want the screen-swipe to interfere.

Are there any ideas as to how I can tackle this problem? I'm new to scripting C# so it would be much appreciated if answers are explaining for newbs.

Thank you.

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

Answer by Graham-Dunnett · Jun 27, 2014 at 12:03 PM

Write code that works out where on the screen the Touch has started, and enable or disable your movement and orbit code accordingly.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Disable cinemachine free look camera movement when touch detected on mobile joystick 0 Answers

Detect swipe along 3d arrows 1 Answer

swipe movement control 1 Answer

mouse input to touch input help please 0 Answers

How do you force points into a straight a line using swipe? 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