My wheel mesh is not staying with the wheel colliders. As soon as i hit play the mest just floats ar

I have created a car in blender . Then i added some wheel colliders toh the mesh. Did everything needed for the car to control. But as soon as i hit the play button the wheel mesh jush floats around the car.
I am using unity version 2018.2.10f1.

First i thought there was something wrong with my car that i created…but i tried the same thing with car assent from unity store…and guess what , the problem still exists.

The wheel colliders are behaving perfectly (they are rotating , moving all perfect there) but the wheel mesh is just floating at bigger radious.
Pl someone help…i am stuck in there from a month now.

Most probably it’s a coordinate issue. Vehicles in Unity should have +Z as their “front” direction. In Blender this means the front of the car should “look” in the -Y direction.

Also, I recommend you to export your car to FBX, then use the FBX model in Unity instead of the Blender model. Ensure the “Apply Transform” option is checked. Then verify the FBX model in Unity: The front of the car should point +Z and each wheel should have its origin in the point they rotate around.

1 Like

I already did everything you just said.the result is same.
Before hitting the play button the transform.pos of the wheel mesh is (0,0,0) . After hitting play, even though the wheel mesh changes its position , the transform.pos is same.
I dont know if it is a bug in unity but…i literaly tried everything.

i have made a short video of my problem. pl have a look.

https://www.youtube.com/watch?v=6d4DgdrLEw4

It’s a problem with your mesh, that’s for sure.

In Unity (min 0:12) I can see these issues:

  • body.000, body.003, body.005 (and possibly 004 too) have a local position of 0,0,0 which should not happen. These positions should be the center of each wheel mesh.
  • body.002 is the body of the car, but the wheels are child of a different GameObject. That doesn’t come from the mesh that way. Ideally, the wheels should be child of the meshes directly in the FBX and Blender files.
  • Meshes have a rotation in X of -90.0. Also, the scale should be 1. This denotes some inconsistency with exporting/importing. Possibly you “broke” the mesh prefab and now you’re using the spare meshes, thus the export option “Apply Transform” may not have a direct effect on your scene. I recommend you to put the FBX in the scene “as is” (no scripts, no modifications) and work with it in Blender until you get it correctly imported in Unity…

In Blender (min 1:31) I can see these issues:

  • All objects are in the root. Wheels should be children of the body, so they could preserve their local positions with respect to it.
  • Front wheels (body.000 and body.003) have their origins correctly placed. They may being wrongly positioned in Unity because you’re using spare meshes, not the entire mesh prefab (as described above) and/or because the wheels are not children of the body, so they may not be preserving their origins on import.
  • Rear wheels (body.004 and body.005) have their origins at 0,0,0 so they won’t work correctly in any case. Their origins should be configured to their respective centers of rotation, and they should be children of the car body.
2 Likes

Thanks man . I will look up all that stuff and see if that works

I did everything you told. And it finally worked.
Thank you so much.

I’m happy to help!

1 Like