I have a basic human armature, nothing fancy, and a plane which is basically flat ground placed at world Z 0.
I have added a driver to the Y axis (which is its world up/down axis) of the root bone of the armature (the root bone moves the whole armature) and what I’m trying to do, is set the position of the root bone in such a way where the foot bone that is closest to the ground plane is “touching” that ground plane (or rather tip of that bone is that world Z 0)
So for example, let’s say footR bone is 10 cm above the ground plane and footL is 30cm above the ground plane, in this case the root bone will be moved 10 cm down, so that footR is sitting on top of the ground plane.
I have wrote this driver script, for the root bone:
(self.location.y-legR) if legR - legL < 0 else (self.location.y-legL)
(legR and legL are simple variables which contain position Z axis value of those bones in world space)
And the issue is that this solution works… but only about 85% works… it keeps the foot closest to the ground plane on top of it for the most part, but sometimes when i play the animation I can see the both feet raised above the ground plane, which should not be possible. And the weird thing is, if I pause the animation playback during that moment, and click somewhere in the timeline (without changing the frame), the armature jumps into correct position, where it aligns the closest foot to the ground. As if the driver wasn’t executed during that frame for some reason.
What am I missing here?
Thank you