2d Animation issue in Unity - Any advice welcome.

Started by
3 comments, last by Buckeye 9 years, 7 months ago

Hello.

Just joined the site as it seems like a great resource.

Currently managing a team of 7 developing a 2D dungeon runner developed in unity. Development has been going great but we have just ran into a big issue.


Our game focuses heavily on collecting armour and weapons. These items are interchangeable and players can mix and match armour pieces.

However when attempting to develop this we have been unable to come up with a system that will allow players to do this.

My question is What would be the best way to implement the animations for this?

Our current understanding would be to chop up the animation into the specific armour pieces and then layer them on top of each other in game to make the full character. This has proven very difficult when it comes to coding this to assemble the character in game.

Advertisement

Well, I have not dived into 2D Animation yet, only 3D one, but AFAIK there are skeletal animation frameworks around for Unity to use. There are certainly paid ones in the asset store, and the new 2D Unity Toolset might also have something like that.

As far as I understood it, with 2D skeletal animation you parent your layers to a skeleton that will then take care of the aligment of the layers as you move parts of the skeleton. Think of it as a 3D skeleton, just in 2D Space (and without real rigging capabilities AFAIK).

If you can mix that with the classical way of animating sprites IDK. Skeletal animations have their limits as far as I see it, so you might want to investigate that first.

You didn't mention how you're implementing your 2D animation. Commonly, that's done using separate sprites in various poses. Animation is achieved by changing the rendered sprite rapidly based on the characters movement and current state (walking, jumping, etc.). IF that's how you're implementing your animations, then you'll have to have a sprite for every character in each pose with each combination of armour/weapons. Alternatively, you will need a sprite for each character (undecorated) in each pose, AND a sprite for each decoration (armor/weapon) in each pose and, yes, render them over the undecorated character sprite.


then layer them on top of each other in game to make the full character. This has proven very difficult when it comes to coding this to assemble the character in game.

Not sure why that would be very difficult - perhaps a pain-in-the-buttocks. Why not select the sprite for the specific armor, the specific weapon(s), etc., from the user preferences - then render the character with the selected decoration sprites?

Depending on your setup, once the user has selected decorations, you can render the entire set of animation sprites (combined appropriately) to a set of user-sprites to be reused until decorations for that user are changed.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Yeah Buckeye that is how we are animating it. Generating large sprite sheets for them.

At this point i am very glad that we cut down the amount of directions the character can face.

Seems less difficult then what I had first thought. Is more just a lot of work instead.

Thanks for the help!


Is more just a lot of work instead.

laugh.png Understood. Sometimes the quantity of work makes it seem more difficult. Been there.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

This topic is closed to new replies.

Advertisement