Bone driver on X location not working

I created a bone and added copy location, and limit location constraint with world space, because when I selected local space, the bone didn't even move, this works fine and the limitations too, but the driver don't. I set a average value driver for when this bone moves on x location to apply a corrective shape key, I tried local space and world space in the driver, but when the bone moves forward on X nothing changes. I've been trying to work this out during one day, and I got a lot of different wrong results, sometimes the value is 1000 in rest pose, and when I move the bone forward it goes to 0, I tried a lot of combinations using the generator modifier and didn't got any success. I want the shape key value to get to 1000 when i move the leg forward, and literally go to 0 when i move it backwards

Display the bone axis.

Driver limited from 0 to 2 moving in Z local direction of bone.

Locally for bones the Y axis goes down the axis of the bone. If you enable the display in armature display properties can turn this on.

The copy location constraint is a bit arbitrary between pose (wrt armature origin) and global.

For the limit location constraint going to use local. The zero of a local transform is its rest position. Ok can set the minimum to 0. Looking at bone axis then +Z is forward, have limited it to 2. An arbitrary choice for this answer and to test against, change to suit.

To change the result to go from 0 to 4 with a generator

which is the equivalent of having a scripted expression for the driver of

0 + 2 * var


which if you remember basic algebra is a linear equation. As mentioned by @Nathan in other answer, this was and issue because it was set to be result zero, no matter what the value of var was.

1000 seems to me to be an outrageously big result, but for this example would use 500 instead of 2.

See driver results.

Find it handy to use the script from this answer when fiddling with drivers

https://blender.stackexchange.com/a/199299/15543

can test the value of a number of variables by looking at output in console, rather than via the driver editor UI.

Look on the modifiers tab for your driver. You've created an "expanded polynomial" modifier for your driver, in replace rather than additive mode, that locks your driver value to 0 because of its settings. Delete this modifier and your driver works (although what you're going for, I don't know.)

• I deleted the driver, the same problem persist, when i move the leg forward, the value decrease, when i move it back, it increase, and then decrease, i want the shape key value to get to 1000 when i move the leg forward, and literally go to 0 when i move it backwards Jan 23, 2021 at 22:11
• @Silly3D Edit your question to provide that information, so that you're asking the question you want the answer to. Jan 23, 2021 at 22:41