Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question 2D Multi-Sprite Limbs?

Discussion in '2D' started by max-jaksa, Sep 18, 2022.

Thread Status:
Not open for further replies.
  1. max-jaksa

    max-jaksa

    Joined:
    Nov 15, 2013
    Posts:
    8
    I’m new-ish (3-4 weeks) into using the 2D IK/Sprite Rigging system. One limitation I'm running into is that I can't figure out how to create skeleton limbs where each limb might be comprised of multiple different sprites (or multiple instances of the same sprite).

    Say I wanted to create a 2D skeleton comprised of multiple bones (forming limbs, etc.) and each bone was represented by a single generic “bone” sprite — is this possible? It seems to me that I’d need to be able to lay out my skeleton and assign bones in the Scene view and not the Sprite Editor view but I can’t find any tools for accomplishing this.

    A different use case might be creating a skeleton for a robot or other mechanical form. In this case, I’d want fully articulating limbs with IK but I wouldn’t want the distorted geometry that comes with adding multiple bones within a single sprite; instead, I’d want each limb to be composed of multiple sprites that move relative to one another but each remains undistorted (like a paper doll).

    Is any of this currently possible in Unity? If so, can someone point me to some documentation for setting something like this up? I’m only seeing tutorial after tutorial for setting up characters that assume each limb should be composed from a single sprite.

    Thanks!
     
  2. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    925
    Hello,
    Could you let us know how your current setup looks like, what you have tried prior to posting here, and where our tools fail you?
    In 2D Animation, we support multiple Sprites skinned to a single bone, if you are working with a .psb/.psd file.
    I would suggest you to check out our samples and documentation pages, if you haven't already, to get a view on how the tools can be used.
     
  3. max-jaksa

    max-jaksa

    Joined:
    Nov 15, 2013
    Posts:
    8
    Hi Ted,

    Thanks for your reply. I've tried a variety of setups and read most all of the documentation that I've been able to find. At this point, I'm not attached to any one setup (and thus, don't have a setup to post) -- I'm really just trying to understand the limitations of the system so that I can make good decisions for my project.

    I think you could boil down my issue to two separate questions:

    1. Is it possible to build a 2D rig in Unity (with IK) that allows for multiple sprites per limb? Imagine an arm with one sprite for the upper arm, another sprite for the forearm, and a third sprite for the wrist/hand, etc.

    2. Is there a way to reuse sprites within a 2D character/skeleton? Imagine I have a spider or something with 8 identical legs - it would seem silly to me to have separate sprites for each leg; instead, I would imagine having art for one leg that I can repeat across the entire character.

    See the attached image to illustrate what I'm getting at (crappy art but you get the idea):

    spider.png
     
  4. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    925
    Thanks for the detailed response, Max!

    Yes, but it is a bit unclear what your definition of a limb is. If you take a look at the Knight.psb character in our Part Swap sample (do note that this sample was updated with new graphics in 2D Animation 9.0.0, Unity 2022.2), you can see that the arms are made up of multiple Sprites, some of which are sharing the same bones.



    Yes, but you would need to put a bit more work into it. The way you could make this happen with your spider is to split the spider up into two .psb/.psd files. One for the leg pieces and one for the rest of the spider. You would then create the bone structure for the leg pieces, and once done, drag out the number of bones your spider require out into the scene, parent them under the same root parent and there you have your character. You can then make the whole set a prefab to more conveniently work with the character.

    Let me know if that answers your questions!
     
  5. max-jaksa

    max-jaksa

    Joined:
    Nov 15, 2013
    Posts:
    8
    Thank you for this, Ted! I definitely hadn't considered separating art into multiple .psb files as I usually try and consolidate things to a single texture atlas wherever possible. I will absolutely give this a shot.
     
    Ted_Wikman likes this.
  6. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    925
    Happy to help!
    If you go down the route of splitting the art into multiple files, you can also take a look at Sprite Atlas, which takes the textures and bakes them into one, making your art easier to batch.

    Best of luck with your project!
     
  7. jillybeanjoy

    jillybeanjoy

    Joined:
    Mar 9, 2024
    Posts:
    11
    is there a way to do this with png files instead of psb?
     
  8. jillybeanjoy

    jillybeanjoy

    Joined:
    Mar 9, 2024
    Posts:
    11
    When I use IK with multiple sprites the sprites disconnect and I can’t get them to connect again
     
  9. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,643
    Please don't necropost/hijack, create your own threads for you own questions.

    Thanks.

    Thread Closed.
     
Thread Status:
Not open for further replies.