Making an automated shape key?

Imagine you’ve got a battering ram and a gate. The battering ram is without any shapekeys whatsoever, however, the gate itself is shape keyed to creak slightly open, to simulate a battering ram, ramming into it.

I am wondering if I can automate this shapekey somehow, so that whenever the battering ram hits against it (the battering ram being keyframed, since I’m talking about an animation) the shapekey for the creaking automatically activates(without me having to keyframe the shape key).

If such doesn’t exist, any way I could achieve a similar effect?

You could use a driver to dive the shapekey value. If your ram rams on the x axis you can use its x location to drive the driver.
Here is a simple example file (the sphere is the ram move it towards the cube):
Ram.blend (769.3 KB)

1 Like

Thank you!!! That is precisely what I need. Never knew about Driver Shape Keys, do you have any useful tutorials that demonstrate them well? Since the ones I encountered felt mostly confusing after giving it a browse.

Okay, so. I tried to replicate what you’ve done with the driver on a cube and sphere of my own. The driver has all the properties of your driver, the shape key is set up, but the sphere of mine doesn’t seem to interact with the cube, any steps I might’ve missed?

Welcome to the world of drivers! Drivers are incredibly useful for animation once you learn them you will love them.
Basically you can use drivers for practically any value in blender including transformation values node values or any value you can think of. When you see a box with a value in it, it can be driven by a driver.
At the beginning they may seem complicated but once you get the general idea they are not that bad.
There are many tutorials here is a simple one

1 Like

My driver was dependent on the incial position of the “ram” the sphere (called cube.001).
it is at 3.904m from the world origin on the x axis. (check the location of your ram in its transform properties.) In the driver editors expression I subtracted 5.6 from this value, which is the rams location plus the gap there is between the ram and the gate. So the driver starts to get a positive value after the location of 5.6 and as the shapekey has a minimal value of 0 it starts to be affected after the ram reaches 5.6m from the world origin.
Take a look at the video it explains the main parts of drivers. The tricky part of drivers is to find a value and expression that suits your needs. The correct expression and resulting value will depend on the positions of your objects in your file.

1 Like

I am afraid that it is a long subject to explain completely, you will have to do some tuts to grasp the concept. It will be worth it because I guaranty you will end up using them all over the place!

1 Like