The goal is to be able to animate multiple AnimatableBody3Ds that are nested inside each other. For this example, think of a billfold at a restaurant, it has 2 hinges, with 3 different faces that rotate 90 degrees (see left image):
Problem
This works fine in the editor, but in the game each piece ignores the movement of its parent, so the origin (hinge/pivot point) stays fixed, and the rotation animation appears to stack (Root/A rotates 90 degrees, Branch/B rotates 180, Leaf/C rotates 270 degrees (see right image above).
Node Hierarchy:
Root
Branch
Leaf
I have tried multiple approaches, using tweens and using AnimationPlayer.
It works fine if A, B, C are just MeshInstance3Ds, but I need AnimatableBody3Ds for collisions.
Using AnimatableBody3D has issues - I can get it to sometimes move correctly using a tween for each of the parts but this has 2 problems: 1) the CollisionShape3D does not follow the mesh, remaining where it started. 2) If the tweens are not started and stopped at the exact same time, each face gets out of sync, and the pivot point can start to drift.