private void FixedUpdate() { float h = CrossPlatformInputManager.GetAxis("Horizontal2"); float v = CrossPlatformInputManager.GetAxis("Vertical2"); float handbrake = CrossPlatformInputManager.GetAxis("Jump2"); m_Car.Move(h, v, v, handbrake); AnalogueSpeedConverter2.ShowSpeed(rb.velocity.magnitude, 0, 80); }
// Update is called once per frame void Update() { float translation = Input.GetAxis("Vertical") * speed; float rotation = Input.GetAxis("Horizontal") * rotationSpeed; translation *= Time.deltaTime; rotation *= Time.deltaTime; rb.AddForce(this.transform.forward * translation * 40); rb.AddTorque(this.transform.up * rotation * 15); AnalogueSpeedConverter.ShowSpeed(rb.velocity.magnitude, 0, 80); AnalogueSpeedConverter2.ShowSpeed(rb.velocity.magnitude, 0, 25); }