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

Joints showing up, but no bones on skeletal animation

Discussion in '2D' started by UnityUser37_1, Jan 29, 2021.

  1. UnityUser37_1

    UnityUser37_1

    Joined:
    Jan 5, 2021
    Posts:
    4
    Hello. Coming up on my 4th week of using Unity.
    I have everything set up on a canvas, and I have 2 frame (2 sprite images) place holder animations set up.
    Now I want to add in the real animations which will use the skeletal animating system and looking at advice online everything says you need to use a image.sprite to create this. So in the hierarchy, under the canvas, I right click on the game object that has the animator controller, and I add a UI > Image. In the inspector for the Image, I link in the correct image for the Source Image. My image now shows up on the canvas.
    Now because I am doing skeletal animation I add a Sprite Skin Component. A Sprite Renderer is automatically added when I do this. Once again, I link the correct image and then when I click Generate Bones, I get 3 joints all stacked on top of each other, but no bones. I also renamed the bones and all the names show up in the inspector, so I know it's the correct bones.
    When I do not use a image.sprite, and instead just drag the sprite onto the canvas and repeat the process for generating bones, all the bones appear and I can animate, but the image does not show on the canvas, and only shows up on the Scene.
    I have gizmos turned on and I am using canvas - screen space overlay.

     
  2. MarekUnity

    MarekUnity

    Unity Technologies

    Joined:
    Jan 6, 2017
    Posts:
    179
    Hello @UnityUser37_1, if I understand correctly, you added the Sprite Skin component manually, is that correct?

    To rig and animate your sprites, you need to follow slightly different workflow. For starter, you can check this page to learn about preparing and importing your artwork, as well as this page to learn about rigging your 2D sprites.

    Basically, you must first select the Sprite Editor on your sprite's import settings and switch to the Skinning Editor:

    From here you will be able to add bones, generate geometry, and adjust weights on your character. I hope this helps you get started.
     
  3. Kalliber95

    Kalliber95

    Joined:
    Mar 27, 2015
    Posts:
    19
    As Marek said, you need to follow a particular workflow in order to do skeletal animation.

    I did up a full guide for it here if ya wanna take a look.
     
    MarekUnity likes this.
  4. UnityUser37_1

    UnityUser37_1

    Joined:
    Jan 5, 2021
    Posts:
    4
    Hello there, thank you for the responses, much appreciated.
    @MarekUnity Yes that is correct, I added the Sprite Skin component manually.
    The only part of those guides that I did not follow, was using a PSB importer because I used a regular PNG image.
    So I believe I had the correct workflow and this is the result with my image outside of canvas where the bones do show up:


    but when I bring the image in the canvas using image.sprite (so that it will show up on the canvas) I have no bones, just the joints for moving things and they are all stacked up:

     
  5. Kalliber95

    Kalliber95

    Joined:
    Mar 27, 2015
    Posts:
    19
    I'm unsure if the skeletal system works within the Canvas Image component as its not considered a sprite renderer/ Im unsure if you can generate a mesh to be used with the bones for the sprite.
     
  6. UnityUser37_1

    UnityUser37_1

    Joined:
    Jan 5, 2021
    Posts:
    4
    Ah dang. So they may be incompatible? At least I know it's not a bug. I guess I have to find a work around or start from the beginning. Thanks for the response though.
     
  7. UnityUser37_1

    UnityUser37_1

    Joined:
    Jan 5, 2021
    Posts:
    4
    I just got it to work. I don't know why this works, but I am a newb, but in my game object that has my animator controller, I created an empty game object, then created the image.sprite and now it works....
    Before I was dropping the image.sprite right into the animator controller.
    Thank you again for the responses, was very helpful in keeping me motivated to figure this out.