- Home /
Question by
OpherV · Aug 03, 2014 at 03:41 PM ·
physicshingejoint
How to make sure hingeJoint is always aligned properly?
I'm working on a prototype for a creature's limbs in my game.
The prototype consists of a box, and a narrower box connected to it with a hingeJoint. The hingeJoint axis is defined to be the big box's up vector. The idea is that every X time, the hingeJoint motor kicks in and moves the smaller box.
Here's the basic paused setup:
My problem is that as soon as the physics system kicks in, the smaller box axis is tilted so that it is no longer sits flush (or close to flush) with the box:
I have a feeling this happens because there's no parenting relations between the two boxes, and the hingeJoint axis isn't changed when the connected body (the big box) up vector changes.
How can I solve this? Or is there a better way to go about this?
Comment