• Runtimes
  • question on multiple skeletons

  • Düzenlendi
Related Discussions
...

Hi,
in my game (cocos2d-x + box2d) I have to connect several skeletons to form a single non-humanoid boss.
Each part of the final boss is edited separately in spine, and used at run-time on a hierarchy of cocos2d nodes (each node is a SkeletonAnimation).

Each part of the final boss can vary in the number of bones and animations, so I decided to treat them as many separated skeletons...

Is this the best approach?

Might be possible to create at run-time a skeleton that inherits all the animations of the individual parts?

In other words:
if I have a dozen skeletons, each with 4/5 bones and different animations, to be combined into a single entity, the best approach is to edit individual skeletons separately on spine and, a run-time, treat them as separate nodes?

If the animations for each part of the boss matches each other you could set the root bone position of each skeleton to match the position of where ever it is attached. This way at runtime you can bind the root bone positions to a bone from another skeleton and have them moving together. Be careful with draw order when doing it this way though.

Ok, clear... but the binding of a "slave" root bone of one skeleton to a "master" bone on another skeleton is an automatic operation or I have to set position and orientation of the "slave" by code at each frame?

You need to set the position at each frame when the bones are not in the same hierarchy.

Ok, as I am doing...
Thanks!

When everything will work, I will verify if there are bottlenecks...