- Home /
How to connect wheel colliders to chassis
Hi there,
I'm trying to build a car rig but I don't have a clue how to connect the wheel colliders. I used this http://unity3d.com/support/documentation/Components/class-WheelCollider.html to create a car with wheels colliders separate from the physical wheels. However, the car chassis is not connected to the wheels and this manual page doesn't state how to do this. I also watched some tutorial video and googled around a bit but everybody seems to skip the task of actually connecting the wheels because it seems obvious but it isn't obvious to me :X
This is how it initially looks in the editor: http://somian.net/stuff/forums/unity/WheelColliders/col1.jpg
but this is what I get when I start the game: http://somian.net/stuff/forums/unity/WheelColliders/col2.jpg
[preview of external content removed for GDPR compliance as it was including 3rd party cookies]
the truck falls through the ground (until the chassis box collides with the ground) but the wheel colliders (the physical, not optical ones) are still are still "standing" on the ground. But how can I connect these :X In a video, it looked like this would automatically work if the wheel colliders are child objects of the chassis objects but that's not the case.
currently
monstertruck
wheel_frontLeft
graphics
physics(wheel collider)
wheel_frontRight
graphics
physics(wheel collider)
wheel_rearRight
graphics
physics(wheel collider)
wheel_rearLeft
graphics
physics(wheel collider)
but I also tried
monstertruck
wheel_frontLeft_graphics
wheel_frontLeft_physics
(etc)
and it didn't work :/
Answer by syclamoth · Mar 15, 2012 at 10:31 AM
No, I've decided. (Sorry about the deleted posts). Make sure the wheels don't have rigidbodies, and then make all four wheels transform children of the body. It works just like any other compound collider, only with weird physics on the end.
Awh, thanks! that error message stating that the wheels need rigid bodies tricked me into thinking I'd have to attach rigidBodies to every object with a wheelCollider but it actually meant that it required the chassis to have a rigid body (which I created afterwards).
works now :)
Wow, that was it? To be honest, I was actually guessing...
HAHA! I had the same problem! Had rigid bodies attached to all the wheels. DOH! Was pulling my hair out! Would have pulled other people's hair out too, if they were here! :P
THAN$$anonymous$$S!!!
I did exactly the same thing, 5 rigidbodies on peered objects. I got it working okay, but wanted to teleport the whole thing. And teleporting objects with joints creates freakiness!
Now have a chassis with a box, and 4 child objects with wheel colliders and no rigid bodies.
Thanks for this thread!! :D
Had rigid body componentes on all wheels too, thanks.
Your answer
Follow this Question
Related Questions
Wheel collider bounce backward 1 Answer
WheelCollider invisible 0 Answers
Directional wheel collider suspension? 0 Answers
The car flies away when wheel collider touch walls or other objects 1 Answer
Wheel collider problems 0 Answers