2D Animation in Unity (Tutorial)

preview_player
Показать описание
Let’s animate our character!

····················································································

········································­­·······································­·­····

► All content by Brackeys is 100% free. We believe that education should be available for everyone.

········································­­·······································­·­····

♪ "ES_Freekin'_Fretless_3" - Mattias Andreasson" by Epidemic Sound
♪ "ES_Dress Code_Black - oomiee" by Epidemic Sound
Рекомендации по теме
Комментарии
Автор

oh boy, if it took brackeys 20 minutes, im gonna be here till tomorrow

ElSrna
Автор

If you need to press space 2 times to play the animation,

You need to go in the CharacterController2D script and change on the line 130 the false to true.

Hope this Helped!

Ball_Zach
Автор

GUYS! If you're jump animation isn't working:
(starting for a split second before you leave the ground)
you don't need to add any ridiculous code. you don't need to modify the character controller. All you need to do is go to both of the exit transitions from the jump animation and turn ON the "Has Exit Time" parameter.

IanAnimatesBagels
Автор

Problem:

If you can't find the sample rate select the three buttons in the top right corner of the animation tab and select show sample rate

somieuler-ajayi
Автор

My man left Youtube years ago, still the best tutor out there. Thanks for all you have done Brackeys:)

CarboAter
Автор

For those who had an error where Idle and Crouch animation are playing at the same time, when you click the player, at the top of the inspector you should see where it is written "Layer". By default the Layer is set to Default, so what you should do is add a new Layer called "player", set the player's layer to that new layer, and finally uncheck the layer at the "what is ground" in the character controller.

xavierturcotte
Автор

once again brackeys has the simplest and most effective solution - we miss you boss! <3

ZickyNee
Автор

I would be lost without Brackeys, thank you for everything you have done <3

OGMoltac
Автор

Animations Sample doesnt exist for me :/
Edit: I found If you click on the 3 dots on the right of the animation tab you can select "Show Sample rate"

adriking
Автор

For those struggling with jumping animation playing for only one frame:

1. Go to somewhere around Line 127
2. Change "m_Grounded = false" to "m_Grounded = true"
If you're having trouble finding this line, it should be after the following if statement:
"if (m_Grounded && Jump)"

SantoshP
Автор

I just started getting into C# and game making in Unity again after hitting a brick wall and quitting a couple of years ago but your videos are really helping me grasp C# and Unity much more than I did before, thanks man I appreciate it!

jarvis
Автор

If anyone is having trouble with the jump animation, check that your ground's layer is set to "ground". Mine was in "default" layer and as soon I changed it to ground everything started working.

Do what Dante says too: "find the ground radius variable [in character controller 2d script] and change it to a lower number like .05"

Hope this helps

bguilleminot
Автор

Thy master shall be remembered
thanks for the experience brackeys
4 months of you gone is like a decade to me

kronos
Автор

IDK if anyone will see this comment
But if your OnLanding is being called too soon and you don't want to change your jump force for whatever reason, try moving your ground check a little more to the center and actually a little higher than you would expect to be the "right" Y position.

I set mine a little higher than what seemed correct (was right on the feet moved somewhere at shin level) and it worked perfectly

danybeam
Автор

For everyone that's struggling with an error where Idle and Crouch animation are playing at the same time to the Character Controller SCRIPT line 67 or 69 there is a ! before crouch. I struggled hours

benevolent
Автор

In case he doesn't mention it in the video, there's a reason that sprite sheets and atlases were developed and are still used in games today. They greatly save on memory and runtime because only a single instance of the sprite array image is loaded into memory at once, and all draws simply render a specific sub-section of the same file pointer in memory.

In Unity, you can see this in action with the batching stats. This is an important concept in any engine, however. Including ones like Unreal or Love2D or Godot or Lumberyard. It's an important concept regardless of the engine, language or technology.

licensetothrill
Автор

Skeletal animation would be so helpful and it looks quicker too

vasil-yt
Автор

I love these tutorials, they are the only reason i know how to do remotely anything in UNITY

th-wolf
Автор

Ok i know im late but for those of you reading this and having the bug with the jumping animation failing to transition to the idle or running animation - i think i found a fix
(atleast it fixed mine)
SO
1 - find the line if(!wasGrounded) in the script that they provided and change it to if(!wasGrounded && m_Rigidbody2D.velocity.y<0)
2 - Look at your CeilingCheck and GroundCheck thingys and see if they're in the right place if not drag each one on your Player thingy on the left they should be under it as if it's a folder
3 - Check if everything about the Animator is the same as yours
Hope it helped :)
(im new to Unity btw so dont judge)

alextashkov
Автор

Adding all the animation took longer than making a menu and exporting the game xD Thanks though this is invaluable info in a very digestible format!!

arcy