• Unity
  • how to transform my character while keeping his animator

Hello
For my game on unity, i'm using the Spine with an Animator. the animator controler is generic, and shared betweens my character. I have multiple character, each with his own spine model.

At some point, i want my player to be replaced by a Vehicle for a short time, the vehicle has his own animations and sprite. But i would like to use the same Animator on the object with the same current states and properties.

For now, i have a spine model for each hero, and a spine model for my car.

I would like the animator, when i play my "drive" animation, to use the car model.

But i dont want to add the car to each spine models and reexport, to avoid geting images duplicated on my atlas png.

So, how should i do this ?
Is this possible to add a skeleton on a slot on the character skeletton, and hiding the rest of the character ?
Do i have to get 2 skeletons component on my character and hide one ?

Related Discussions
...

It depends on the interaction that you need between car and character, but I would definitely keep car and characters as separate Spine objects.

In Unity, you could create a separate Seat GameObject and attach a BoneFollower component to it to follow a bone of your car Spine object, then you could re-parent the character to be a child of this seat GameObject. Animations like getting into the car could then be aligned nicely, even if the car was moving. Some parts of the car could be rendered in front of the character (e.g. the door, some framing, etc), and some behind (e.g. some parts inside of the car).

Another way to hide parts of the character would be to use the clipping feature of Spine, however you might need different clipping-polygons for different cars.

Please let me know if this helps.

Hello. @Harald. i'm not trying to get the hero sit on a car, but his model is completely hide, and he play a car instead, more like a metal slug or yosi island tank.
Let's Play Super Mario World 2 Yoshi's Island - Part 04: Mole Tank Time - YouTube

the hero "become" the car, and once the car phase is over, the car diseapear and the hero model is back. it is 2 differentss skeletons, but i would like to keep runing the same animator

Edit : is this possible for one animator to animate 2 objects at the same time with spine ?

Sorry, I misunderstood your question.

It works if you provide the same animations at both Spine objects. I just verified this by using Spineboy with a Raptor controller of the example scenes. It works e.g. on the walk animation, since both provide one. If I however transition to an animation that exists only under the other object, you will receive errors.