• Unity
  • Multi skeletons, Changing characters on runtime,

  • Đã chỉnh sửa
Related Discussions
...

Hy

i would like to know the best practices for working on a game in which we have multi tier riders and rides ...and they should be swap able..
ie a lv3 rider can have a lv1 ride and vice a versa..

there are many problems that i am facing right now.

1= all riders wont sync with all rides especially on y axis motion...if i discard y axis motion from rider then i am not able
to place it in ride in unity so it will have ride y axis motion..

2= All the animations that i have done till now have different sizes..like tier 1 is around 600*600 pxl... and increasing as the tier increases..due to which i am facing scaling issues

SaadFayyaz đã viết

1= all riders wont sync with all rides especially on y axis motion...if i discard y axis motion from rider then i am not able
to place it in ride in unity so it will have ride y axis motion..

While I don't know your exact setup, I assume that it's similar to a rider with motorbike scenario (I'll use these terms for the sake of easier reading).

  • One Skeleton
    One solution I could think of would be to create a single combined Skeleton that includes both the rider and the bike. Then you could use Spine's Skins functionality to switch the look of the bike or the rider. You can check out the Mix and Match Skins example scene that comes with the spine-unity package on how to combine two partial skins. If the geometry of the bike changes and requires the posture of the biker to change accordingly, you could to this via animations like e.g. posture-harleydavidson and posture-racingbike, which would then place e.g. an IK hand target bone higher or lower to match the handle bar. You could also use Skin-Bones, but this is a rather advanced topic which might be overkill here.

  • Separate Skeletons
    You could also create two separate skeletons for the rider and the bike. Then you would still have separate posture animations at your biker, and perhaps also programmmatically place the IK hand target bone in Unity to adjust the hands to arbitrary positions. You could still use Skins to change the appearance of your rider and bike separately, and you could even replace the bike with any GameObject which does not have to be a Spine Skeleton.

SaadFayyaz đã viết

2= All the animations that i have done till now have different sizes..like tier 1 is around 600*600 pxl... and increasing as the tier increases..due to which i am facing scaling issues

What do you mean by "animations have different sizes"? Did you export your animations as image sequences? If so, then this is not a good idea at all, you should instead export it as a skeleton in either json or binary format. Please have a look at the spine-unity documentation page and the example scenes on how to export and use Spine skeletons in Unity:
spine-unity Runtime Documentation

The Issue with skin pipeline is that we have 4 types or riders and rides all different in Tier1
then again 4 types or riders and rides in Tier2 and so on and so forth till tiers 5... and all riders and rides have animations like idle attack hurt stun death.
and all riders should work with all rides and all rides should work with all riders..


and what i mean by all "animations have different sizes" is that i have skeleton data and jason file pipeline using runtime in unity..But there export size is there import size and there import size is the psd's size and the psd's sizes are all different

SaadFayyaz đã viết

The Issue with skin pipeline is that we have 4 types or riders and rides all different in Tier1
then again 4 types or riders and rides in Tier2 and so on and so forth till tiers 5... and all riders and rides have animations like idle attack hurt stun death.
and all riders should work with all rides and all rides should work with all riders..

I still see nothing that would change the scenario in a way that would render my answer posted above invalid. If your riders are radically different in that they don't share anything but the animation names (e.g. a quadruped and a humanoid character all requiring the same animations) then you should create separate skeletons for these radically different rider types (or use the Skin Bones feature). For those that are very similar, you can share a skeleton. I would then again suggest to use e.g. an IK hand target bone which can be adjusted to where the different bike's handles are located.

SaadFayyaz đã viết

and what i mean by all "animations have different sizes" is that i have skeleton data and jason file pipeline using runtime in unity..But there export size is there import size and there import size is the psd's size and the psd's sizes are all different

Thanks for the additional info. Unfortunately I still don't understand why this would cause any scaling issues. In general you should aim for consistent texture resolution on screen (constant texel size per screen space). Or do you perhaps mean that your attachments have different proportions (width / height) and are thus stretched where you don't want them to be? Could you perhaps share some screenshots that show the problems you are encountering?