Question by
alsuleimani90 · Jul 24, 2016 at 02:55 PM ·
androidiosmovecar
Move unity car in android & iOS
I have used unity car, it is working fine for pc .. How can I move it for other platforms android and iOS?
private void FixedUpdate()
{
#if CROSS_PLATFORM_INPUT
float h = CrossPlatformInputManager.GetAxis ("Horizontal");
float v = CrossPlatformInputManager.GetAxis ("Vertical");
#else
float h = Input.GetAxis("Horizontal");
float v = Input.GetAxis("Vertical");
#endif
// pass the input to the car!
//float handbrake = CrossPlatformInputManager.GetAxis("Jump");
if (fuelLevel > 0 && moveCar ) {
m_Car.Move (h, v, v, 0f);
fuelLevel -= 0.1f * Time.deltaTime;
fuelText.text = fuelLevel.ToString ();
} else {
fuelText.text = "0";
m_Car.Move (0f, 0f, 0f, 100f);
}
}
Comment
Your answer
Follow this Question
Related Questions
Unity Smooth Move and Zoom UI on Canvas for Android/IOS 0 Answers
How powerful is unity for Android? 2 Answers
MOBILES WITH MOVIETEXTURE CAN'T BUILD 0 Answers
How to play a 360 degree video with stereo mode in Unity 3D 0 Answers
WebCam Texture Rotation 0 Answers