Search Unity

Cascading Hinges lead to an Axis Mess [solved, mistake]

Discussion in 'Physics' started by Yany, Oct 16, 2017.

  1. Yany

    Yany

    Joined:
    May 24, 2013
    Posts:
    96
    Hi,

    I have an issue that seems to be simple, but somehow it does not work.

    I want to give a car 4 wheels. (yes I know about wheelcollider, but that's not good for me for some reason)
    So I have a body, and 4 wheels. If I simply create a hinge for all the wheels, they rotate perfectly as I expect. However the two front wheels need to turn. For that, I add an intermediate object between the body and each of the front wheels. I break up the hinge between the body and the front wheels, but connect the wheels to the intermediate objects (let's call them steerobj). Also I connect each of the two steerobjs to the body on the Y axis.

    Now I have the following physics hierarchy: body --> (y) steerobj --> (x) wheel

    From this moment, I can rotate the steerobjs around the axis Y, works perfectly, but the wheels stop rolling. I can see that the axis is screwed up when I run the scene, both the wheel and steerobj axes become parallel. Why? I tried out a tons of trick to turn them into the right direction, also I tried to add both the hinge joints to steerobjs (one connection to the body, and the other to the wheel), but it didn't work. I tried out to give a collider to the steerobjs too, but nothing changed.

    Also I tried out that everything works just fine if I connect the steerobj hinge to null (make it fixed to the static space). This way both the wheel and the steerobj can be rotated on the axis they have on their hinge. When I connect the steerobj hing back to the body, everything is wrong again.

    Can you help me please? Any hints, workarounds... and of course a real solution would be much appreciated. Thank you.
     
  2. Yany

    Yany

    Joined:
    May 24, 2013
    Posts:
    96
    It would be fair if I posted my discovery that led not only to the solution, but also made me realize that noob issues happen often... at least with me. :D Weke.

    So, the wheel didnt't roll because it collided with the car hull. Originally (without steering capabilities) it doesn't matter as they are hinged together and by default the two directly connected objects are not colliding with each other, but if I add an intermediate object, the two end of the connection chain collides again. That's it for today. Thanks and sorry for the false alarm. Have a nice day.