I’m trying to animate a rubber diaphragm, which is pushed up/down in the center by a plunger, but locked in place at the outsides; I had used a hook to animate this deformation, but now I’m noticing that the hook doesn’t seem to animate in BGE when I start game mode.
Is there any way to get it to animate?
Is there another way to rig this diaphragm if I cannot use the hook?
Is there anyway you could post the blend? That would go a long way in helping the rest of us to understand the exact nature of the issue. You can definitely do that with an armature, but not using an armature doesn’t really explain why it isn’t working for you. The way I see it, for something simple like a single degree of freedom, there is no real benefit of preferring an armature to any other sort of control object.
You set this up by first parenting the diaphragm to the armature, and choosing ‘armature deform -> empty groups’. Then you parent the plunger to the bone and choose ‘bone’.
After this you have to select which verticies are deformed by the plunger bone, by going into edit mode for the diaphram, select the verticies in the loops around the head of the plunger, then go over to object data -> vertex groups, select ‘plungerbone’, and then ‘assign’.
I also locked transformation of the bone everywhere other than the up and down axis (which I think is the bone’s local y)
I had originally uploaded a solution with two bones and a constraint, but that was way to complex for this. But if you wanted the travel of the bone not to deform the diaphragm in the up direction (as if there is no physical attachment between the plunger and the diaphragm), you would need the second bone.
I think the issue with using empties for this is that the hook modifier doesn’t seem to have any implementation in the game engine. So armature it is.
The action and logic are associated with the armature instead of the plunger. I moved some stuff around XD.
In the dopesheet editor, at the bottom, where it says ‘+ New’, click the icon next to that to get a dropdown with a list of actions (the action is called ArmatureAction). That will re-populate the dopesheet and timeline with the data for the action.
Yeah, not a problem. I imagine you will probably end up with a much more complicated machine to animate as you continue your project (whatever it is :P), and assuming you will have to use armatures for a large part of it, I highly recommend this video series, titled ‘Humane Rigging’:
It is the best rigging tutorial/explanation I have come across so far.