Im getting this error :Assets\Scripts\Car.cs(32,32): error CS1061: ‘WheelCollider’ does not contain a definition for ‘position’ and no accessible extension method ‘position’ accepting a first argument of type ‘WheelCollider’ could be found (are you missing a using directive or an assembly reference?)
Assets\Scripts\Car.cs(33,32): error CS1061: ‘WheelCollider’ does not contain a definition for ‘rotation’ and no accessible extension method ‘rotation’ accepting a first argument of type ‘WheelCollider’ could be found (are you missing a using directive or an assembly reference?)
Can i Get some help please
public class Car : MonoBehaviour
{
public WheelCollider wheelColliderLeftFront;
public WheelCollider wheelColliderRightFront;
public WheelCollider wheelColliderLeftBack;
public WheelCollider wheelColliderRightBack;
public Transform wheelLeftFront;
public Transform wheelRightFront;
public Transform wheelLeftBack;
public Transform wheelRightBack;
public float motorTorque = 100f;
public float maxSteer = 20f;
void FixedUpdate()
{
wheelColliderLeftBack.motorTorque = Input.GetAxis("Vertical") * motorTorque;
wheelColliderRightBack.motorTorque = Input.GetAxis("Vertical") * motorTorque;
}
void Update()
{
var pos = Vector3.zero;
var rot = Quaternion.identity;
wheelColliderLeftFront.GetWorldPose(out pos, out rot);
wheelColliderLeftFront.position = pos;
wheelColliderLeftFront.rotation = rot;
wheelColliderRightFront.GetWorldPose(out pos, out rot);
wheelColliderRightFront.position = pos;
wheelColliderRightFront.rotation = rot * Quaternion.Euler(0, 180, 0);
wheelColliderLeftBack.GetWorldPose(out pos, out rot);
wheelColliderLeftBack.position = pos;
wheelColliderLeftBack.rotation = rot;
wheelColliderRightBack.GetWorldPose(out pos, out rot);
wheelColliderRightBack.position = pos;
wheelColliderRightBack.rotation = rot * Quaternion.Euler(0, 180, 0);
}
}