Unity Community


Results 1 to 13 of 13

  1. Posts
    62

    Car Tutorial for Android

    I'm trying to port Car Tutorial to Android, but when I switch the platform to Android, I get a lot of errors.
    Is there the Car Tutorial ported over the forum?
    Thanks and sorry for my bad english


  2. Location
    Meredith, NH USA
    Posts
    122
    The Car tutorial is very complicated. I doubt just changing the build to Android you are even going to get close to running that game.

    One, you need to figure out how you are going to deail with Input, Two any javascripts need to have #pragma strict to enable strict compiling for performance (this could mean a bunch of refactoring). Three, who knows what other errors come up after you have managed to kill the first two batches.

    Mike
    Think for yourself or someone else will.

    http://www.teotigraphix.com
    Specialize in Modeling, Unity3D, Audio and Native Android
    Did Flash/Flex and ActionScript for 10 years, thought it was time to move on


  3. Posts
    132
    It is much easier to port Andrew Gotow's car tutorial. All i had to change was the input method if i remember correctly.


  4. Location
    Meredith, NH USA
    Posts
    122
    It is much easier to port Andrew Gotow's car tutorial. All i had to change was the input method if i remember correctly.
    Do you have a link for that?

    Mike
    Think for yourself or someone else will.

    http://www.teotigraphix.com
    Specialize in Modeling, Unity3D, Audio and Native Android
    Did Flash/Flex and ActionScript for 10 years, thought it was time to move on


  5. Posts
    132
    Here. I dont have my laptop with me (my ported version is there)

    Change this part of code:
    Code:  
    1. // finally, apply the values to the wheels. The torque applied is divided by the current gear, and
    2.     // multiplied by the user input variable.
    3.     FrontLeftWheel.motorTorque = EngineTorque / GearRatio[CurrentGear] * Input.GetAxis("Vertical");
    4.     FrontRightWheel.motorTorque = EngineTorque / GearRatio[CurrentGear] * Input.GetAxis("Vertical");
    5.        
    6.     // the steer angle is an arbitrary value multiplied by the user input.
    7.     FrontLeftWheel.steerAngle = 10 * Input.GetAxis("Horizontal");
    8.     FrontRightWheel.steerAngle = 10 * Input.GetAxis("Horizontal");

    Change Input.GetAxis with Input.acceleration, and that should be it.


  6. Location
    Canada
    Posts
    375
    I am working on a racing game for iOS and started with the car Tutorial. I got it to work, but with MAJOR changes. I wouldn't recommend this approach. If I were doing it again I wouldn't do this. Try one of the car packages in the asset store.


  7. Posts
    574
    When I changed to Input.acceleration.x and same for y.....while exporting it to android 10 errors for SmoothFollow.js is coming 'unknown identifier' for many variables
    Last edited by jessica1986; 04-02-2012 at 03:24 AM.


  8. Location
    Lithuania
    Posts
    133
    Someone has remade it and sells it on android market https://play.google.com/store/apps/d...=search_result


  9. Posts
    574
    Im lookin out for the solution to my problem


  10. Posts
    574
    can any1 help me on dis


  11. Location
    Meredith, NH USA
    Posts
    122
    This probably means that you don't have variables by type defined in the script scope.

    Can you post the lines of code that are throwing the error?

    Mike
    Think for yourself or someone else will.

    http://www.teotigraphix.com
    Specialize in Modeling, Unity3D, Audio and Native Android
    Did Flash/Flex and ActionScript for 10 years, thought it was time to move on


  12. Location
    Iran - Tehran
    Posts
    8
    Quote Originally Posted by Jessica1986 View Post
    When I changed to Input.acceleration.x and same for y.....while exporting it to android 10 errors for SmoothFollow.js is coming 'unknown identifier' for many variables
    remove SmoothFollow.js and import scripts package again
    +++++++++++++++++
    http://unity3d.ir
    +++++++++++++++++
    2d&3d OnlineGames
    +++++++++++++++++
    http://bazidoon.com
    +++++++++++++++++


  13. Posts
    132
    Quote Originally Posted by Jessica1986 View Post
    When I changed to Input.acceleration.x and same for y.....while exporting it to android 10 errors for SmoothFollow.js is coming 'unknown identifier' for many variables
    add "var" in front of those undefined variables in SmoothFollow.js and it wont give you any errors.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •