using System.Collections; using System.Collections.Generic; using UnityEngine; public class WheelDrive : MonoBehaviour { private WheelCollider wheelCollider; public float torque = 200; // Start is called before the first frame update void Start() { wheelCollider = GetComponent(); } private void Go(float accel) { accel = Mathf.Clamp(accel, -1, 1); float thrustTorque = accel * torque; wheelCollider.motorTorque = thrustTorque; } // Update is called once per frame void Update() { float a = Input.GetAxis("Vertical"); Go(a); } }