You can now easily attach objects to (animated) bones in your models, e.g. to attach a weapon to animated character’s hand.
This is performed by setting the TCastleSceneCore.ExposeTransforms property. It allows to “expose” transform nodes within a TCastleScene
. Transform node is TTransformNode
, which in particular represents “bones” animated by glTF and Spine. “Expose” means that we create children TCastleTransform instances, which follow these bones. Subsequently, you can place new scenes inside these children, e.g. add weapons to the hand bone.
It is all nicely visual, ExposeTransforms can be set in the CGE editor using a comfortable dialog box. The children transforms are automatically created and named.
You can also use ExposeTransformsPrefix to avoid name collisions.
See the example application examples/animations/expose_transformations_to_animate_children.
Start the discussion at Castle Game Engine Forum