- 수정됨
Working on chimera type of monsters...
Hi all
I am working on my game where all the monster are generated like a Chimera, combing different head, body, arms, and legs to form a monster.
I thought about this use Skin. But the problem is I don't want each part always share the same bone and do the same animation. For example, when I call "Walk" animation on my monster, all his body parts their own walk animation. Then, when I swap his head to another head, the new head will also play its own walk animation. This means they don't share the same bone formation.
Excuse me for my bad English. Please let me know if there is something I need to clarify about my question.
Please help me with this! Thank you so much!!
The solution is to create different skeletons for each distinct body part (head or legs or whatever), especially when you need them to move and animate differently, and have different bones.
You don't need to use Skins, but also you have that option to use Skins in combination with the above solution if you want.
There's a planned feature called SkeletonAttachment (basically attaching a skeleton to a bone of another skeleton), and that would've been the right way to combine those different parts. But that's pretty far away in terms of when it will be added to Spine since it's a pretty complex feature to add.
But right now, at runtime, Spine-Unity has tools that allow you to let any GameObject follow any of the bones on your skeleton. So you can use that to manually combine different Spine GameObjects in Unity editor, and also play the right animations together by controlling those many different SkeletonAnimation components together.
Thanks for the reply! Sorry I was out of the country for few days...
So basically the solution right now is to create different GameObjects (ie. Head with its own spine skeleton and animation), then attach (make it follow) the bone of my body skeleton? Am I right?
If yes, would you show me a basic code example how I make a GameObject follows bone? Much appreciated!!!
Spine-Unity comes with a component called BoneFollower
.
It's designed to go on any GameObject and it will follow a bone on a Spine GameObject.
For best performance, make the bone-following GameObject a child of your Spine GameObject.
One way to add this is to right-click on your SkeletonAnimation component, and choose "Add BoneFollower GameObject".
You can also just add BoneFollower from Unity's normal Add Component menu, if you have a premade GameObject.
The BoneFollower component's code is quite simple, so if you wanted, you could also copy its code into your own component.
Let us know if something about it confuses you.
Really really thanks to your answer!
I will play with it