Limit Location being a pain!

Im trying to “rig” a chest of drawers. I have the draw sliders, and im trying to use the limit location constraint to give the draw a natural slide in and out function.

So I want the inside track to start here…


and then slide to here and stop, and then when sliding back, stop at its original position…


I have the minimum Y value as 0cm and the maximum value as 36cm (or something like that), yet it doesn’t seem to take any note of this, or will work, but only backwards (So rather than the slider going to where it is in the second pic, it slides through the back of the mesh :confused:

Am I using it wrong?

I have tried applying scale, location roation etc…

Sorry, Now you mention it I think it probably is something to do with the origin…here is a .blend of the track…The inner track on the top one. I have the inner sliders as 1 object, and the origin sits right in the middle, which may also be part of the problem.

drawrig.blend (1.01 MB)

Just insert the correct limit locations you want for the Y axis. Look at the locations in the properties panel and copy/paste into the constraint boxes. The object is not centred in the viewport hence the weird x locations


Attachments

drawrig.blend (989 KB)

In your screenshot it looks like you have the sliders moving individually. If they’re all one object with an origin out in space, that’s going to cause some weirdness. Object constraints really only care about the object’s origin point, scale, and rotation values. You do need to apply the scale and rotation for this to behave properly. Your goal here seems to be to get the back end of the slider to stop when it gets to be about 36 cm forward of its current position. So at the very least you want the object origin to be situated along the back edge of those sliders. But object constraints aren’t as flexible as bone constraints, so it’s still going to care about the object’s location. If you limit its Y to a minimum of -36cm (which is the transformation for 36 cm forward) it’s going to kick in when it gets to a position of -36 on Y. That doesn’t really fit with its current location. You’d be better off using an armature so you can take advantage of bone constraints. Especially since you could then control each drawer individually. Like so: drawrigBones.blend (1.16 MB)

It turns out the distance you want those to travel is more like 35 cm, since 36 takes it all the way to the end of the track. But otherwise…

Richard M:
Thanks for that…I dunno why i didn’t try doing that in the first place, Im such a blender noob some times!

K Horseman:
I did plan on making the draws open and close individually, but I was just trying to get the constraints working first before I seperated them all. I was going to use bones originally, but I guess being slightly lazy took over…I didn’t realise that there would be a difference between bone constraint and object…Thanks, your solution is brilliant!

Thanks for the help :smiley:

People often try object constraints because they think it’ll be the easier solution. If it were easier to get the desired results without an armature, why were armatures invented? :stuck_out_tongue:

I know I’m oversimplifying, but the point is that armatures are your friend, and they will usually make your life easier.