• RuntimesUnity
  • making modular characters with Spine

I'm currently working on a project where we are trying to create modular characters that the player will be able to customise by swapping limbs in and out.

my thought process was to build it by creating a base rig which has bones that work as parent slots for the head and other limbs to be parented to. My intention with this was to create a simple unique rig and asset for each possible modular part which can then be parented to the corresponding slot on the base rig inside unity. The reason for keeping the limbs separate in this way is that we intend to have lots of variation of design and proportion to allow for more creative outcomes for the player.

the idea for example an arm would be made of a simple 2 bone IK setup, the target would then be parented to a hand control and all of this would be parented to the shoulder attachment bone of the base rig inside unity, I proposed doing it this way because the alternative seemed to be having all the limbs and assets within one spine file which would amount to a very complex and messy rig which I don't think would be particularly usable.

we also want to have a rag doll effect on the character when the player picks them up and moves them but for some reason the rag doll physics doesn't seem to allow for multiple separate rigs even If parented together once in unity, there seems to be an issue with the limbs snapping back into position once moved which I think could be related to having an IK system but I'm unsure.

I would love to hear peoples thoughts on this and if there is a more optimal workflow that I'm missing, to summarise I'm looking to create modular characters made from combined spine files that are then parented together inside unity and allow for rag doll physics.

thanks in advance for any input!

Related Discussions
...

@Otimms In general we would recommend using a single skeleton where skins would be combined like in the Spine Examples/Other Examples/Mix and Match Skins example scene. You would then combine a specific leg skin with a differend arm skin, and so on to achieve your desired combination. This would allow for better control of e.g. attachment draw order, etc, which would be harder to control with e.g. 5 separate skeletons.

Regarding creating a ragdoll setup:
The example SkeletonRagdoll component that comes with the spine-unity runtime creates a ragdoll setup for a single skeleton. It's not intended to be used for (or tested with) multiple nested skeletons. However, the example components are mostly intended as a starting point to base your own specific implementations on. So you should be able to create your own ragdoll component based on the code in SkeletonRagdoll with the addition of supporting multiple nested skeletons.

Hi @Harald thank you for the quick reply

wouldn't using a single skeleton become very messy if for example we wanted to have several different kinds of arms not just simple reskins so varying in length and proportion as well?

I will take a look at the example projects you mentioned to see if they can help, thanks!

  • T.Fly() и Harald ответили на это сообщение.

    Otimms You can create template skins for each arm length/proportion type, since transform constraints can also be part of a skin that changes length and other properties. Then simply apply the right template skin that matches the attachment image you want to use.

    Otimms wouldn't using a single skeleton become very messy if for example we wanted to have several different kinds of arms not just simple reskins so varying in length and proportion as well?

    That's where skin-bones come in handy:
    http://esotericsoftware.com/spine-skins#Skin-bones
    You can then have a set of bones for a normal arm, a long arm, or 6 arms, tentacles, and so on and drive those bones all in the same skeleton project from e.g. a single attack animation. At runtime only the skin-bones active by the selected skin are updated each frame (so no extra performance overhead occurs).

    On the contrary, I would imagine it rather difficult to have multiple projects for multiple arm types and stick them together suitably for the same attack animation. It depends on your specific use case however.