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
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
It is much easier to port Andrew Gotow's car tutorial. All i had to change was the input method if i remember correctly.
Here. I dont have my laptop with me (my ported version is there) Change this part of code: Code (csharp): // finally, apply the values to the wheels. The torque applied is divided by the current gear, and // multiplied by the user input variable. FrontLeftWheel.motorTorque = EngineTorque / GearRatio[CurrentGear] * Input.GetAxis("Vertical"); FrontRightWheel.motorTorque = EngineTorque / GearRatio[CurrentGear] * Input.GetAxis("Vertical"); // the steer angle is an arbitrary value multiplied by the user input. FrontLeftWheel.steerAngle = 10 * Input.GetAxis("Horizontal"); FrontRightWheel.steerAngle = 10 * Input.GetAxis("Horizontal"); Change Input.GetAxis with Input.acceleration, and that should be it.
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.
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
Someone has remade it and sells it on android market https://play.google.com/store/apps/details?id=air.WORLDRACING3D&feature=search_result
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