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 ThomasQ · Mar 30, 2011 at 01:14 AM · androidioscarcontrol

iOS / Android Steering

Hi!

I'm fairly new to unity, and I was looking for a tutorial or some scripts with wich I can steer a Car using Android / Iphone.. I was planning on working through the Penelope tutorial (it's interchangeable betweet iOS & Android, right?), but seeing that that it is a 3d person tutorial, I was hoping someone could point me in the driving direction..

Or is it maybe possible to tweak the script from the Car Tutorial, since i've done that Tutorial a couple of times now..

Anybody any suggestions on where to look?

Thanks in advance! Thomas

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Macdude2 · Mar 30, 2011 at 02:53 AM

Also, if you have not bookmarked it, the unity reference manual is full of good information and some basic application script of iphone and android touch based code. The Unity Wiki is also a great place to find information and code.

Script Reference: http://unity3d.com/support/documentation/ScriptReference/

Unity Wiki: http://www.unifycommunity.com/wiki/index.php?title=Scripts

Below is the script reference link to some basic script describing how to use the accelerometer:

http://unity3d.com/support/documentation/ScriptReference/Input-acceleration.html

Below is some of the only code from the car controller that would need to be converted to work with the iphone:

However, if you want to make a car game for the iphone, their is a lot of superfluous code that you would need to edit out of the car.js script included in the car tutorial assets to make the physics and effects simpler.

Good luck with your project.

function GetInput() { throttle = Input.GetAxis("Vertical"); steer = Input.GetAxis("Horizontal");

 if(throttle < 0.0)
     brakeLights.SetFloat("_Intensity", Mathf.Abs(throttle));
 else
     brakeLights.SetFloat("_Intensity", 0.0);

 CheckHandbrake();

}

 function CheckHandbrake()
 {
     if(Input.GetKey("space"))
     {

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

Answer by Justin Warner · Mar 30, 2011 at 02:35 AM

If you're fairly new to this... I suggest reading through the tutorials... I personally didn't do them, because that's like me just copy paste 'ing code... So I suggest just going through them, seeing how to do different things... Now, don't go through the tutorial, but recreate something similar... Now, keep on adding things to make it actually closer and closer to the real product, and learn step by step...

ANYTHING, will help you... Don't just stay on Android/iOS stuff, just make sure when you code for your project for the PC, LOOK at the actual iOS and Android in the API, to see how you'd do that for it...

Just my opinion though =).

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

No one has followed this question yet.

Related Questions

How to make camera position relative to a specific target. 1 Answer

Android/IOS First Person Shooter 2 Answers

Touchscreen car controls 2 Answers

About unity's API for android? 2 Answers

Android not working 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