Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How can I create a sprite "image" from a PSB file that contains the many layers of a sprite?

Discussion in '2D' started by bullettea, Apr 15, 2023.

  1. bullettea

    bullettea

    Joined:
    Oct 24, 2019
    Posts:
    29
    I have a character in a PSB file that was created in different layers (layer for the body, left leg, right leg, etc.)
    Everything is positioned where it should be in the file (all the parts are in the right place to create the character's image).
    I drag the file into my Project (Textures folder), and when I turn on the Skinning Editor, all the parts are where they should be, and I can add a skeleton and animate it accordingly.

    So far, so good.

    Now while this gives me a nice sprite I can animate, here is the problem: I also want a separate "picture" of this sprite for use on a UI button.

    I don't want it animated, just the same image you get if you opened up the sprite in the PSB file, in its default pose. Yet I can't drag this "SPRITE" onto the canvas into the button because it's not a sprite. It's become some kind of holding object that contains all the different sprite body parts.

    Should I just make .pngs of all the characters and use them for the button sprites instead? It seems inefficent because I already have the "image" of the character, it just exists in pieces in Unity. Any suggestions appreciated, thank you!
     
    jackmitchell3002 likes this.
  2. DanielTanBK

    DanielTanBK

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    80
    Hello, there are a few ways of doing this using the Sprite/PSB importer

    1. If you simply want all the layers to be merged into a single sprite, you can set the Sprite Mode to Single
    Unity_cv4hPPBeXD.png

    2. If you want to custom slice the whole image into multiple sprites, leave the Sprite Mode on Multiple, change the Import Mode to Merged, open the Sprite Editor and create Sprite Rects around the sprites you want and Apply
    Unity_A8yGr8Tlw6.png

    Additional info
    Sprite editor manual: https://docs.unity3d.com/2023.2/Documentation/Manual/sprite-editor-use.html
    PSB Importer manual: https://docs.unity3d.com/Packages/c...0/manual/PSD-importer-properties.html#general
     
    bullettea likes this.
  3. bullettea

    bullettea

    Joined:
    Oct 24, 2019
    Posts:
    29
    This is so helpful! Thank you so much Daniel. :)