I noticed you don’t actually use a physics engine for that, but kind’s built your own thing. Unless I am missing something - any reason you choose to implement motor and joint physics on your own?
To answer your direct question - The local axes of the wheel change when you rotate it constantly. I think the rotation axes should be calculated according to the car’s current state, and that you should add joint-elements to do the actual wheel rotation. So - either calculate current rotation in world space for each frame, or connect an object to rotate, and to it connect the wheel, which will preserve its local axes.
I don’t have a working example (and I am sure someone from the community will do a far better job than me), and this is, of course, just a suggestion
Thank you very much for a good example with axes. I tried to turn the machine according to an example, changed all the axes in the rotations, but the wheels still spin incorrectly
Note line 104 since wheel is imported already vertical this is not necessary and lines 248 to 258 axis Y replaced with Z for same reason. The problem of the imported wheel is setting up its center correctly, I used a transformation of y = 4.11 but it is off a little which is noticeable as you turn the wheels.