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 question was closed Apr 28, 2014 at 03:46 AM by robertbu for the following reason:

Design question

avatar image
0
Question by Rusty7889 · Apr 28, 2014 at 03:46 AM ·

How to use Input.GetAxis in Touch Screen to make 2D Controller

Hello all,

Currently I'm trying to get a little 2d game going however I want to stay away from an on screen touch pad / button if possible.

What I would like to achieve is the same kind of control as in the standard 2d side scroller however I want to do this with the touch commands.

Now I kind of figured out how to move left and right with Input.GetTouch, and Input.TouchCount however what is tripping me up is the jumping. I would like it so when the player presses&holds on the screen the character in the game runs in that direction. Since its a 2D game this will either be left or right(X axis) However when the player taps the screen I would like the character to jump.

I can't seem to get this to work and I'm not sure where to start as the I don't know how the game would differentiate between when the player is taping/holding on the screen to run in a direction and when it will be a jump as it would see the original tap to move the character.

I thought about just having the player hold down on the screen and scroll in the up direction(Till it hits the Y Axis) to get the character to jump but I don't know if that would really work either.

If this is a limitation of touch abilities just let me know and I'll start looking into a on screen game pad system. If someone can however think of a way to get this to work or point me in the right direction that would be great.

Many 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 robertbu · Apr 28, 2014 at 03:47 AM 0
Share

We ask that design problems be posted to Unity Forums. Unity Answers is designed to answer single, specific technical questions.

There may be an issue of usability, but you have a universe of gestures to use. Two finger taps, double taps, swipes, pinches, drags, stationary holds, etc.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

20 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

GUI cale and position according to the actual screen resolution. 1 Answer

Raycast Destroys player. 1 Answer

GUI.HorizontalSlider not working 2 Answers

How To Make GUI Buttons Load/Quit 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