Wheels rotating wrong way

Hi! I just made a script from tutorial and now wheels are spinning wrong axis. Please help.

Here is code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SimpleCarController : MonoBehaviour
{
    public void GetInput()
    {
        m_horizontalInput = Input.GetAxis("Horizontal");
        m_verticalInput = Input.GetAxis("Vertical");
    }

    private void Steer()
    {
        m_steeringAngle = maxSteerAngle * m_horizontalInput;
        frontW.steerAngle = m_steeringAngle;
    }

    private void Accelerate()
    {
        rearW.motorTorque = m_verticalInput * motorForce;
    }
    private void UpdateWheelPoses()
    {
        UpdateWheelPose(frontW, frontT);
        UpdateWheelPose(rearW, rearT);
    }
    private void UpdateWheelPose(WheelCollider _collider, Transform _transform)
    {
        Vector3 _pos = _transform.position;
        Quaternion _quat = _transform.rotation;
        _collider.GetWorldPose(out _pos, out _quat);

        _transform.position = _pos;
        _transform.rotation = _quat;
    }
    private void FixedUpdate()
    {
        GetInput();
        Steer();
        Accelerate();
        UpdateWheelPoses();
    }
   
    private float m_horizontalInput;
    private float m_verticalInput;
    private float m_steeringAngle;

    public WheelCollider frontW;
    public WheelCollider rearW;
    public Transform frontT;
    public Transform rearT;
    public float maxSteerAngle = 30;
    public float motorForce = 50;

}

Here is video:
kovpqi

Is it possible for you to share your WheelCollider.cs script as well? That will probably help people be able to tell what’s going on.

I dont have script like that. I only have made wheel collider objects

It looks as though your wheel meshes have been modelled on the wrong axis (for this purpose).

Ours are the same. What we’ve ended up doing is having, in the scene:

WheelCollider_Object
Thing_We_Position_In_Update_Wheel_Pose
Actual_Wheel_Mesh_Turned_To_Face_Right_Direction

I don’t understand what you said in end. Im very new in unity.

7600600--943246--upload_2021-10-25_14-6-29.png

Is that what your scene looks like? Is the wheel mesh a separate or child object to the one with the collider on it?

This is part of our scene. The wheelcollider you can see is on the ‘frontright’ object.
It has a child that I’ve renamed to PassThisToUpdateWheelPose.
PassThis… has a child Rt_front_tyre, and that’s the one with the mesh on it.