Suggestions for "syncing" animations

I want to incorporate animations in my game that will play together, such as the player opening a door would trigger the “open door” animation on the character, and the “open door” animation on the door itself. I also want a lot of similar type things for various other stuff, like putting a briefcase on a table then opening it.

obviously to do this I would need to come up with some conventions like a standard door size, standard table height etc. but theres some stuff im not quite as sure what to do. for instance when a character opens a briefcase the briefcase animation would need to start maybe a half second to a second after the character animation starts…

Has anyone tried to attempt this sort of thing before? do you have any advice on how I could organize my animations in blender or my animation code in java such to reduce the amount of overhead that could go on here? Ideally id like to come up with a flow that largely involves just creating the animations correctly in blender and being able to import them and not have to do much else besides a little bit of code to just detect what animations are on the model.

Another question I have. Does anyone know how to attach stuff to a bone in blender in a way that would mimic getAttachmentNode().attach(briefcase) ? so that I could use to help line up my keyframes and stuff (and then be able to just delete the briefcase or whatever item from the character model after i make the animation)

2 Likes

Well usually this stuff is just hardcoded, eg either start animations always a the same time, and just have the breifcase a 0.5sec nothing in it start, or code the delay somewhere and start the animatin actually delayed.

A possible solution might be to split animations, and useing a anim listener. That way you only need to make sure the middle part is synchrnous, the first and last can be different length.

player: startopen
listener notifies of end of animation
birefcase: startopen
player: doopen
listener notifies of end animation
player:return to idle translation