How to Make a 2D Character Creator in Unity

preview_player
Показать описание
LINKS

SUMMARY
This 2D character creator can be expanded to include a virtually infinite number of body parts and options to fit your own Unity games. The player can select any combination they choose, then click play to begin their adventure. Also, in the overworld scene, there's a mini version of the character creator to show how all animations can be updated in real time. This might be useful to anyone working on an inventory system with equipable armor or items.

STEPS
1. Create animations for each body part.
2. Make a parent game object with an Animator attached.
3. For each body part, make a child game object with a Sprite Renderer attached.
4. Add layers in the animator for each body part.
5. Use Scriptable Objects to store animations for each body part.
6. Write a script to select body parts.
7. Write a script to update body parts using an animator override controller.

😎 Join the Discussion!

Video Content
0:00​ - Intro
0:49​ - Layered Animations
1:20​ - GameObjects for Layered Animations
1:45​ - Animator Layers
2:41​ - Scriptable Objects
3:34​ - C# Script to Select Body Parts
5:15​ - C# Script to Update Animations
7:40 - Final Product
Рекомендации по теме
Комментарии
Автор

This is the best video I could find on the topic. I wish it was a little more in depth, because I'm too stupid to comprehend it all at the speed you're going.

ThePancakeJedi
Автор

My players keep asking me to add this.... I think this is SUPER FEATURE CREEP!
Thank you so much for this. Now at least I can have a look at it.

MosolaStudios
Автор

Dude, I can't thank you enough! This is exactly what I needed for my project. This can also be used to customize town NPCs!

BreakingNuyt
Автор

When I say I've been waiting for this for a long time, I mean it!

ParkerDeVenney
Автор

Thanks my brother for this tutorial. I've been looking for this tutorial for long now.I'm happy now. too much.thank you very much. ✊🙏

hendrickvanwyk
Автор

Hello dear! Thank you very much for the wonderful tutorial.

I have a question.

I have the main animator, and below are his children.
The children have Sprite Renderers as it appears in your video.

But in my case they are not directly associated and therefore the clips do not play, am I doing something wrong?

Thanks for your time!

jonathanbarone
Автор

I really enjoyed watching this! I'd love to see a 3D version of it

TylerGreen
Автор

How do I reference the Animator layout for each body part game object. I was tried to renamed the child object then the sprite renderer wasn't rendered. Can u help me. sorry about my English

hoangdaovan
Автор

You're saved my game!!! Thanks!!!

michal
Автор

is there any way to make the animation process from the sprite sheet automatic? cause making animations for every single sprite takes a lot of time and seems quite unnecessary for such an easy task

DavrK
Автор

Really great stuff! Thank for putting the time to make the video and sharing the project with us, much appreciated!

durvids
Автор

At 2:46 after finishing step 4, only the bottom animation layer is playing with the body, hair, and torso not playing their animations. What did i do wrong?

Netherzapdos
Автор

Thanks for the video, not sure if you'll see this comment or not. If I just want to change the color of certain body parts, what would the best way to do this be? I can obviously access the spriterenderer component and set that (not sure if this is the best way or not) but how could I save this to the animator? Would the animation overwrite the sprite renderer color change if I just handle color this way

Or would it just instead be better to have 4 individual versions of the same outfit, just in different colours. I was thinking of just splitting each body part and changing the sprite colour in a script instead?.

lolwizbe
Автор

This tutorial is fantastic, but I'm struggling with actually tying this to the button ui; I've tried to set it up exactly as in the tutorial but I still can't get the player's layers to update.

DOUBLE EDIT: I can see in the inspector that my body parts are updating, but the new animations are not actually being applied to the sprite renderer; I have the correct renderers referenced in each animation, but they still won't update?

MajinMaster
Автор

Thank you for this video! Is it possible if I can make a body part group have different layer order depending on the object selected? For example, in accessories, I plan to add hats that will be layered on top of the head, but some accessories like wings would go under the head and the body. Is that possible? And how do I program that?

albinokoi
Автор

I`m having an issue that it only shows one of the layers and it need to have a renderer on the parent object. When I only have them on the children and only an animator on the parent nothing is rendered. DO you have any idea why that might be?

Thanks!

RaphzTube
Автор

Whats the difference between body and then torso and legs

a.m.thepro
Автор

Perfect video. I stopped the video at the outline ~0:53 and figured out how to implement the different parts by myself, I couldn't conceptualize how I would go about doing this whole thing. Thanks a ton and I suggest including the outlines every video!

nful
Автор

hey did you make your own art? cause id love to know how to import pixel art into unity and what kind of sprite sheets or character sheets to use

violetevans
Автор

Qustion :
If i have comectics for exaple like face cosmetic like glasses . If my model turn around(facing back) soo you can;t see face do i remove glasses or do something else?

andrzejsawpl