I want to have a Monster where i can swap out body parts. Like if I were to rip an arm off one monster and put it on another. That arm could be a claw, and it would inherent the animations of the claw attacks. With the animations, how do you merge them together dynamically? Would I be animating just the individual module body parts in spine, and in unity mount all the parts together? The goal is to have a large variation of monsters by being able to generate them randomly in a sense. Is this the right approach, is this overly ambitious?
  • 記事: 1


This sounds like a fun game 8)

You could be using the rather recently added Skin Bones feature to create a skin for e.g. each radically different arm type, so you can switch both the attachments and active bones at the same time, while still playing back the same animation. So you would have a single skeleton with e.g. a set of claw-arm skin bones, and another set for e.g. winged-arms, etc. The attack animation would then animate all those bone sets at the same time, nevertheless only one set of arm bones will be active and visible. So this part is not too ambitious as such if you ask me.
Like if I were to rip an arm off one monster and put it on another.
This is the part where it depends on what exactly you mean by "rip an arm off": if you want to physically detach an arm and move it around, things will get a bit more involved.

You could theoretically use a SkeletonUtilityBone hierarchy to programmatically override the bone location of e.g. the shoulder bone, where all your arm skin-bones are attached to. You could then use whatever game logic or physics to set the overridden position accordingly. But note that the animation of the arm will then still continue, so most of the time you may not want this.

It might then be easiest to just remove the respective arm skin from the joint skin (which disables attachments and skin bones) and display an entirely different non-animated sprite there.

Note that such limb-detachment logic will always be more complex to get it right, especially when using physics.

  • 記事: 1826

Return to Unity