Forum rules - please read before posting.

Rigging Animation

Hi, I'm developing a 2D game and working on a character with 8-directional movement using Unity's rigging system. I have a few questions about setting up the PSB files and rigging:

  1. Do I need to create a PSB file that includes the character in all 8 directions and then set up 8 different rigs within the same prefab?
  2. Should I select "Sprites Unity Complex" for the player's animation engine?

    Thanks a lot for your help.

Comments

  • edited May 15

    Do I need to create a PSB file that includes the character in all 8 directions and then set up 8 different rigs within the same prefab?

    Generally, this is down to personal preference / specifics of the character's design.

    Having a separate rig for each direction takes time to set up, but once done, it's generally easier to animate for - since you always have the rig set up with the direction you want to control.

    The other approach would be to use a single rig, and then use sprite-swapping to swap e.g. the character's torso sprite to show its left/right/up/down etc variant. This was the approach (the non-AC game) Broken Age took.

    Should I select "Sprites Unity Complex" for the player's animation engine?

    Yes, I'd recommend this when dealing with anything more than a basic sprite-swap-only character. You have a lot more control with the use of parameters, which can be used to affect mulitiple layers in the Animator.

  • edited May 16

    Thank you for your fast feedback as always!

    I just wanted to clarify a couple of things:
    For now, I'd like to use multiple rigs since it sounds easier to manage. So here’s what I did:

    Approach I: One Prefab with 6 Different Poses
    • I created one PSB file with 6 different poses of the same character.
    • I imported the PSB file into Unity and created 6 different rigs within one prefab.
    • I created animations for this prefab.
    • I turned the prefab into a "Player".
    • The animation engine for this player is set to Sprites Unity Complex.
    • Move speed float is set to MoveSpeed.
    • Body angle float is set to FacingAngle.
    • I attached additional settings like this (https://imgur.com/a/chYl27J).

    However, this approach didn't work, so I tried a different method:

    Approach II: 6 PSB Files with Each Pose
    • I created 6 separate PSB files, each with a different pose of the same character.
    • I created animations for each prefab and then dragged and dropped these animations into the idle animation.
    • I followed the same steps as in my first approach, but this version also didn't work.

    Both approaches only show the idle animation of the character and not any other animations.

    My game is in 2D, and I've been using Sprite Animation for my project, so I apologize if my question seems too basic. I've spent the last week working on the rigging but still couldn't figure it out. Any help would be greatly appreciated.

  • The first approach sounded fine. Can you elaborate on how things didn't work, exactly? Were the parameter values updating correctly when viewed at runtime?

    One thing I would say is that you might be better off avoiding blend trees, since the different rigs can't be blended together. Try relying on the "Direction integer" instead, which corresponds to 0=down, 1=left etc (see the Manual's chapter on Sprites Unity Complex for more), and have them transition to discrete states on the base layer.

  • Thank you so much for your help. I recreated all the PSD files and rigging, and then used the "Direction" integer instead of a Blend Tree, and now it is working! I also decided to use just two directions for my character for now. Your frame flipping script was a tremendous help!

    I couldn't figure out what I did wrong, but it was probably something in the Blend Tree with parameters as you mentioned. Also, until now, updating the PSB sprite broke the meshes, rigs, slices, etc., so I was skeptical about using the 2D rigging system since Unity seems to have lots of bugs.

    As always, I can't thank you enough!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.