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 Shankar · Apr 26, 2013 at 11:04 AM · race

Object motions in race game?

Hi all,

I am making a small game. in that i don't know how to write code to tap for tablet. i want object to move left side when we tap on left side and right side when we tap on right side.

http://www.appsapk.com/speedcar/

After installing apk u can get my question.

Is there any special library to access for that.

Thanks & Regards

Shankar

Comment
Add comment · Show 2
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 Yokimato · Apr 26, 2013 at 12:26 PM 0
Share

No one is going to download and install something to help you. You need to put some more time in yourself until at least you can ask it without having people figure out your question to.

avatar image Shankar · Apr 26, 2013 at 12:30 PM 0
Share

Ok.. i have already informed everything in question itself. its just only to people for better understanding.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by robertbu · Apr 26, 2013 at 01:00 PM

Your question is vague. See Input.touches for the interface to handle touch input in Unity. There are third-party tools that abstract away mouse/touch differences making it easier to develop for touch devices. We use FingerGestures which can be found in the Asset Store. TouchKit from Prime31 has been mention on this list. It is free and can be found here. As for the game, moving left and right will depend on how you move your vehicles: translation, rigidbody physics, or character controller. In addition, most racing games have some curves and needs some sort of path following. A free place to start with paths is with iTween and the PutOnPath() and PointOnPath() methods.

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 Shankar · Apr 27, 2013 at 05:20 AM 0
Share

Thanx a lot $$anonymous$$r. Robertbu for ur response. You were only telling me about gestures and mouse/touches. But accutually what I need is that, for suppose if I have a cube on my screen, If I tilt my tablet to right, the cube should move to right and the same with left. I want this to work in Unity 3D. Are there any special methods?? Even though I have tried many ways I din't find any solution for it. Thanx in advance

avatar image whydoidoit · Apr 27, 2013 at 07:16 AM 0
Share

You need to use Input.acceleration - which is the accelerometer reading. Normally that is a vector of magnitude 1 for a device lying at rest, the vector points into the screen.

When you tilt the device it's still pointing downwards, so you can work out the angle that the device is at using that.

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

15 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

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Can someone help me fix my Javascript for Flickering Light? 6 Answers

Setting Scroll View Width GUILayout 1 Answer

Material doesn't have a color property '_Color' 4 Answers

How to import the object from server to unity 2 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