raycast on a mesh collider fail

Why raycast ignore the mesh colliders?
i have all LayerMask and no detect

Vector3 vector2 = 0.5f * (allWheels[0].transform.position + allWheels[1].transform.position) - new Vector3(0f, 0.5f, 1f) * .5f;
        RaycastHit raycastHit;
        isGrounded = Physics.Raycast(vector2, -Vector3.up, out raycastHit, .5f,wheelPhysics);

You have a float set to where an int should be in Physics.Raycast method. It might be throwing it off.

public void LoadVehicleSettings() {

        CenterOfMass = new GameObject ("CenterOfMass");
        CenterOfMass.transform.parent = transform;
        //create rigidbody//
        rBody = gameObject.AddComponent<Rigidbody>();
        rBody.collisionDetectionMode = CollisionDetectionMode.ContinuousDynamic;
        rBody.mass = 100f;
        rBody.angularDrag = 5f;
        rBody.centerOfMass = CenterOfMass.transform.position;

        //set up the wheels//

        //rear left wheel//
        Mesh mesh = allWheels[2].GetComponentInChildren<MeshFilter>().mesh;
        colLB = new GameObject("colLB");
        SphereCollider col = colLB.AddComponent<SphereCollider>();
        if(allWheels[2].transform.childCount > 0) {
            colLB.transform.position = allWheels[2].transform.position;
        } else {
            colLB.transform.position = allWheels[2].transform.position + mesh.bounds.center;
        }
        col.material = tirePhysicsMat;
        col.center = new Vector3(0f,-.25f,0f);
        colLB.transform.SetParent(transform);
        Wheel wheelScript = colLB.AddComponent<Wheel>();
        wheelScript.vehicleObj = gameObject;
        wheelScript.wheelObj = allWheels[2];
        wheelScript.wheelLB = true;
        wheelScript.wheelHangDistance = wheelHangDistance;
            allWheels [2].transform.parent = transform;

        //front left wheel//
        mesh = allWheels[0].GetComponentInChildren<MeshFilter>().mesh;
        colLF = new GameObject("colLF");
        col = colLF.AddComponent<SphereCollider>();
        if(allWheels[0].transform.childCount > 0) {
            colLF.transform.position = allWheels[0].transform.position;
        } else {
            colLF.transform.position = allWheels[0].transform.position + mesh.bounds.center;
        }
        col.material = tirePhysicsMat;
        col.center = new Vector3(0f,-.25f,0f);
        colLF.transform.SetParent(transform);
        wheelScript = colLF.AddComponent<Wheel>();
        wheelScript.vehicleObj = gameObject;
        wheelScript.wheelObj = allWheels[0];
        wheelScript.wheelLF = true;
        wheelScript.wheelHangDistance = wheelHangDistance;

        turnLF = new GameObject("turnLF");
        turnLF.transform.parent = transform;
        turnLF.transform.position = allWheels[0].transform.position;
        turnLF.transform.rotation = allWheels[0].transform.rotation;
        allWheels[0].transform.SetParent(turnLF.transform);
        wheelScript.turnObj = turnLF;
        wheelScript.frontTire = true;

        //rear right wheel//
        mesh = allWheels[3].GetComponentInChildren<MeshFilter>().mesh;
        colRB = new GameObject("colRB");
        col = colRB.AddComponent<SphereCollider>();
        if(allWheels[3].transform.childCount > 0) {
            colRB.transform.position = allWheels[3].transform.position;
        } else {
            colRB.transform.position = allWheels[3].transform.position + mesh.bounds.center;
        }
        col.material = tirePhysicsMat;
        col.center = new Vector3(0f,-.25f,0f);
        colRB.transform.SetParent(transform);
        wheelScript = colRB.AddComponent<Wheel>();
        wheelScript.vehicleObj = gameObject;
        wheelScript.wheelObj = allWheels[3];
        wheelScript.wheelRB = true;
        wheelScript.wheelHangDistance = wheelHangDistance;
        allWheels[3].transform.parent = transform;

        //front right wheel//
        mesh = allWheels[1].GetComponentInChildren<MeshFilter>().mesh;
        colRF = new GameObject("colRF");
        col = colRF.AddComponent<SphereCollider>();
        if(allWheels[1].transform.childCount > 0) {
            colRF.transform.position = allWheels[1].transform.position;
        } else {
            colRF.transform.position = allWheels[1].transform.position + mesh.bounds.center;
        }
        col.material = tirePhysicsMat;
        col.center = new Vector3(0f,-.25f,0f);
        colRF.transform.SetParent(transform);
        wheelScript = colRF.AddComponent<Wheel>();
        wheelScript.vehicleObj = gameObject;
        wheelScript.wheelObj = allWheels[1];
        wheelScript.wheelRF = true;
        wheelScript.wheelHangDistance = wheelHangDistance;

        turnRF = new GameObject("turnRF");
        turnRF.transform.parent = transform;
        turnRF.transform.position = allWheels[1].transform.position;
        turnRF.transform.rotation = allWheels[1].transform.rotation;
        allWheels[1].transform.SetParent(turnRF.transform);
        wheelScript.turnObj = turnRF;
        wheelScript.frontTire = true;

        gameObject.tag = "Player";
        BoxCollider col3 = gameObject.AddComponent<BoxCollider>();
        col3.size = new Vector3(3.5f,1.5f,5.5f);
        col3.center = new Vector3(0f,.8f,.5f);
        col3.material = bodyPhysicsMat;

        carInfo = GetComponentInChildren<CarInformation> ();
        IsLoadedVehicleSettings = true;
    }

i’m using spherecollider

Sorry can u watch this threads i need really help on this.

To be honest, I’m confused about what the problem is. Can you lay it out as simply as possible? Explain the exact problem in detail, highlight any code that’s involved using code tags, and include any pictures or videos. Please post these inline so we can see them in context.

Can u check this?