2D Animation in Unity (Tutorial)

Let’s animate our character!
● Check out Skillshare: skl.sh/brackeys8
● Watch Player Movement: • 2D Movement in Unity (...
● Download the Project: bit.ly/2KK5AG8
● Character Controller: bit.ly/2MQAkmu
● Get the 2D Sprites: bit.ly/2KOkwjt
❤️ Donate: www.paypal.com/donate/?hosted...
····················································································
♥ Subscribe: bit.ly/1kMekJV
► Join Discord: / discord
● Website: brackeys.com/
● Facebook: / brackeys
● Twitter: / brackeystweet
········································­­·······································­·­····
► All content by Brackeys is 100% free. We believe that education should be available for everyone.
❤️ Donate: www.paypal.com/donate/?hosted...
········································­­·······································­·­····
♪ "ES_Freekin'_Fretless_3" - Mattias Andreasson" by Epidemic Sound
♪ "ES_Dress Code_Black - oomiee" by Epidemic Sound

Пікірлер: 3 000

  • @ElS3rna
    @ElS3rna3 жыл бұрын

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

  • @austinlee7691

    @austinlee7691

    3 жыл бұрын

    SAAAMEE

  • @TheDiamondMc88

    @TheDiamondMc88

    3 жыл бұрын

    Good one

  • @deleteduserontop2b2t22

    @deleteduserontop2b2t22

    3 жыл бұрын

    no brackeys can do it in 5 minutes but he explains while showing you stuff to do

  • @cheeselover0743

    @cheeselover0743

    3 жыл бұрын

    what 1 day? wow thats fast i am here for a month

  • @anoop_brar

    @anoop_brar

    3 жыл бұрын

    Same

  • @Ball_Zach
    @Ball_Zach2 жыл бұрын

    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!

  • @frederiksommer8171

    @frederiksommer8171

    2 жыл бұрын

    Thanks :)

  • @greganimations3366

    @greganimations3366

    2 жыл бұрын

    Thank you very much :D

  • @luffymaster47

    @luffymaster47

    2 жыл бұрын

    Tx

  • @luffymaster47

    @luffymaster47

    2 жыл бұрын

    (130)

  • @JHawkins

    @JHawkins

    2 жыл бұрын

    Nailed it, however it is line 130. m_Grounded = true; // note: this was false when downloaded from Brackeys.

  • @IanAnimatesBagels
    @IanAnimatesBagels3 жыл бұрын

    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

    @IanAnimatesBagels

    3 жыл бұрын

    (and also make sure your ground check is outside of your bottom collider)

  • @omegachonker9987

    @omegachonker9987

    3 жыл бұрын

    thanks this really saved me from insanity xd

  • @omegachonker9987

    @omegachonker9987

    3 жыл бұрын

    however you do have to set the jump animation to exactly the time you spend jumping otherwise you either end the animation in mid air and it looks really weird if you make it to short and if you make it too long then you end up on the floor looking like your falling anyone got a workaround?

  • @IanAnimatesBagels

    @IanAnimatesBagels

    3 жыл бұрын

    @@harshitpal4996 do you have it set to play in the animator controller and have the animation triggered by script like in the video?

  • @shanujoshi1937

    @shanujoshi1937

    3 жыл бұрын

    Thanks!! you saved me :)

  • @somieuler-ajayi5246
    @somieuler-ajayi52462 жыл бұрын

    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

  • @Artemisi_

    @Artemisi_

    2 жыл бұрын

    Thank you so much

  • @premasoupl4150

    @premasoupl4150

    2 жыл бұрын

    thank youuu

  • @XiTrOnEexe

    @XiTrOnEexe

    2 жыл бұрын

    thank you buddy

  • @mrpooptheiii3444

    @mrpooptheiii3444

    2 жыл бұрын

    thx

  • @vayn5726

    @vayn5726

    2 жыл бұрын

    you saved me thanks

  • @jarvis911
    @jarvis9115 жыл бұрын

    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!

  • @CarboAter
    @CarboAter11 ай бұрын

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

  • @OGMoltac
    @OGMoltac3 жыл бұрын

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

  • @Officergizmo

    @Officergizmo

    3 жыл бұрын

    If you would only have known

  • @uzidayo

    @uzidayo

    3 жыл бұрын

    @@Officergizmo lol

  • @magiclessbrat8501

    @magiclessbrat8501

    3 жыл бұрын

    Please tell me how you add character controler

  • @AugustasWeb

    @AugustasWeb

    Жыл бұрын

    @@magiclessbrat8501 its complicated

  • @autismclips5076
    @autismclips5076 Жыл бұрын

    All of your Unity tutorials are absolutely amazing, they've been helping me so much in learning game development! Keep up the great work!

  • @ZickyNee
    @ZickyNee3 жыл бұрын

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

  • @jood7449

    @jood7449

    3 жыл бұрын

    hey man youre like the most recent comment on here and im having trouble with the events component under the character controller script, i cant find a solution to it and a i was wondering if you knew

  • @thebigduckproduction9044

    @thebigduckproduction9044

    3 жыл бұрын

    Yea true

  • @elranstorm197

    @elranstorm197

    2 жыл бұрын

    most effective - kill me

  • @SHLFBEATS

    @SHLFBEATS

    2 жыл бұрын

    @@jood7449 if i were you id join the discord if you haven’t. Theres a bunch of smart ppl that will help.

  • @ArquimedesOfficial

    @ArquimedesOfficial

    2 жыл бұрын

    its a nice tutorial, but using physics for 2d collisions is not efficient, physics is very expensive...you should use tiled based collisions instead...

  • @th3-wolf130
    @th3-wolf1304 жыл бұрын

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

  • @i_28_tesla
    @i_28_tesla3 жыл бұрын

    thank you so much brackeys! your 2d tutorials are just what i need! thank you so much for uploading these or i would have been gone crazy if i were to do it myself or with another video. Thank you for helping me making my own first 2D platformer by the art of uploading videos.

  • @xavierturcotte7777
    @xavierturcotte77772 жыл бұрын

    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.

  • @AneksKuchenny

    @AneksKuchenny

    2 жыл бұрын

    Thanks a lot, you rescued me

  • @NakedSageAstrology

    @NakedSageAstrology

    2 жыл бұрын

    Thank you for the tip, but mine still seems to be trying to activate both without pressing anything...

  • @onionhead8399

    @onionhead8399

    2 жыл бұрын

    i don't know if you still alive but you saved me after hour of suffering

  • @luckythedev2361

    @luckythedev2361

    Жыл бұрын

    when i click on "what is ground" they dont show me uncheck option how i uncheck player layer?

  • @quimmich

    @quimmich

    Жыл бұрын

    what a champ

  • @kronos2107
    @kronos21073 жыл бұрын

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

  • @adriking5383
    @adriking53834 жыл бұрын

    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"

  • @Tortuex_

    @Tortuex_

    3 жыл бұрын

    thank you so much couldn't figure it out

  • @florentbacale3280

    @florentbacale3280

    3 жыл бұрын

    @@Tortuex_ How did you do it ? I can't seem to find it, the three dots only propose to close tab or add another for me

  • @Tortuex_

    @Tortuex_

    3 жыл бұрын

    @@florentbacale3280 it's the three dots right under those, it needs to be on the animation panel and not the "global" panel :) try and find three dots below the ones you found ;)

  • @stunity1767

    @stunity1767

    3 жыл бұрын

    Thank you so much, this really helped!

  • @anishsrivatsan2332

    @anishsrivatsan2332

    3 жыл бұрын

    Thanks a lot! I couldnt find it either, but your comment helped :)

  • @guymen8
    @guymen84 жыл бұрын

    Thanks for being so patient 😊😁! It's a fantastic tutorial and the previous two were also awesome! That's a great series!

  • @evewhoo
    @evewhoo5 жыл бұрын

    This was a lifesaver! Thank you so much! Everything was explained very clearly.

  • @henryjohn6244
    @henryjohn62445 жыл бұрын

    finally, after the error are occurrence. I can make animation for my character. Thank you so much Brackey.

  • @INAVACL
    @INAVACL4 жыл бұрын

    This is exactly the video I needed! I made different art pieces for animating in unity and wasn't sure how to go about it.

  • @robertharbison4199
    @robertharbison41995 жыл бұрын

    Your tutorials are so helpful. I would love to see a skeletal animation one! Thanks for your hard work.

  • @wafflewarriorthe3rd
    @wafflewarriorthe3rd5 жыл бұрын

    Thank you so much, this is saving me during my platform design final.

  • @IvanBoychuk
    @IvanBoychuk2 жыл бұрын

    Incredibly easy and clear! Definitely you are the best tutorial channel about Unity!

  • @GrenadierPete
    @GrenadierPete4 жыл бұрын

    I should have found this video at the start of the weekend! Great job explaining transitions! It all makes sense to me now! And yes, skeletal animation would be interesting to learn!

  • @licensetothrill
    @licensetothrill5 жыл бұрын

    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.

  • @bguilleminot
    @bguilleminot3 жыл бұрын

    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

  • @totallyrandompersob1664

    @totallyrandompersob1664

    3 жыл бұрын

    If the jumping animation doesn't work still, maybe try keeping on exit time for when it switches to idle or running. Don't keep Transition time. Only keep it for when it goes from Any State->Jumping. Turn off exit time too on Any State->Jumping. I hope it helps because it worked for me. Not the perfect solution, but it works. I know I'm coping and pasting on everything EDIT: don't do it it causes a weird glitch if you keep pressing the jump button in midair.

  • @Arel_Kursat

    @Arel_Kursat

    2 жыл бұрын

    my character more like a meatball (the free unity asset with that red ball like character) and the slopes was not triggering the grounded bool in character controller. Normal terrain was fine even without any layering. Adding layer didn't worked so I went ahead and edit the character controller to add a second ground check and placed it both to each edges of the character and it worked wonderfully.

  • @dominicbermea9828

    @dominicbermea9828

    2 жыл бұрын

    I couldn't figure out the first one, but the ground radius variable worked!

  • @joshlikesmusic8619
    @joshlikesmusic86193 жыл бұрын

    In my game the "Crouch" animation made me hover, so I edited the Character Controller a lil so it removes 2 colliders. Now it's Smooooth. Loved the vid, long time coder, first time unity user. Definitely a thumbs up!

  • @FreakofNature147
    @FreakofNature1473 жыл бұрын

    I seriously love what you do. Thank you for everything!

  • @Spartaton
    @Spartaton5 жыл бұрын

    I think covering skeletal animation is a great idea. Perhaps consider looking at the new skeletal 2D animation being integrated into Unity rather than or in addition to Anima 2D.

  • @jonatan01i

    @jonatan01i

    5 жыл бұрын

    @Bobby5z0 you bastard xd

  • @scrub4749
    @scrub47495 жыл бұрын

    Hey, im having a problem where while jumping my animation switches from jumping to idle animation mid jump. I would set up some kind of velocity parameter but i dont know how

  • @theemeraldfalcon9184

    @theemeraldfalcon9184

    5 жыл бұрын

    it needs to loop i've checked mine but the animation doesn't loop do you know why?

  • @tylerstyle307
    @tylerstyle3074 жыл бұрын

    2D animation is easier than I thought it would be! Thanks Brakeys!

  • @salesman4396
    @salesman43964 жыл бұрын

    Your teaching style is amazing ! God Bless

  • @vasil-yt
    @vasil-yt5 жыл бұрын

    Skeletal animation would be so helpful and it looks quicker too

  • @NotBanned_

    @NotBanned_

    5 жыл бұрын

    It is less quality, of course.

  • @crob3545

    @crob3545

    5 жыл бұрын

    Not Enough Horror. It seems it would be good for a 2D physics based fighting game like the one Im gunna try make

  • @Issung123

    @Issung123

    5 жыл бұрын

    Both have their pros and cons, you cannot get a pixel style like in this video with skeletal animation

  • @Mrabet_Houssem

    @Mrabet_Houssem

    5 жыл бұрын

    actually you can , look for Dead Cells

  • @cocobos

    @cocobos

    5 жыл бұрын

    sprite swap is the best for pixelarts though.

  • @chrismeier3923
    @chrismeier39235 жыл бұрын

    I am finding that all of my character movements and animations work perfectly, but the jump animation doesn't activate unless my character is already off the ground. I tried moving my ground check up a bit, but it just looks like the jump animation flickers and then stops. While I am in the air, if I hit the jump button again, the animation works. Any suggestions?

  • @Hylian_SK

    @Hylian_SK

    2 жыл бұрын

    @animeharmonics Thank You!!!

  • @greatmy1050

    @greatmy1050

    2 жыл бұрын

    Yo same

  • @greatmy1050

    @greatmy1050

    2 жыл бұрын

    @animeharmonics It didn't work for me

  • @SHAHSAMINYASAR
    @SHAHSAMINYASAR3 жыл бұрын

    The great thing is that you keep your *smile* _visible>true_ in all your videos...keep going!

  • @77chickennug84
    @77chickennug84 Жыл бұрын

    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)"

  • @duyne7128

    @duyne7128

    Жыл бұрын

    Bro, TYSM you saved my life

  • @lovfall642

    @lovfall642

    Жыл бұрын

    Thank you so much!

  • @mannycalavera121

    @mannycalavera121

    Жыл бұрын

    Thanks mate, this is what i was looking for

  • @sil3ntsoldier236

    @sil3ntsoldier236

    Жыл бұрын

    THANK YOU. U R A LEGEND 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏

  • @ziadhassan7

    @ziadhassan7

    Жыл бұрын

    And you also need to check off (can transition to self ) on the transition from anyState

  • @leopoldo1586
    @leopoldo15865 жыл бұрын

    I would LOVE a video on anima 2d

  • @imconfused6955
    @imconfused69555 жыл бұрын

    Your On Land event is checking too soon and that's causing my character to stop jumping immediately after leaving the ground. Any idea on why this is happening and how I can fix it?

  • @alizlatan4331

    @alizlatan4331

    5 жыл бұрын

    I'm Confused same

  • @teda-t6757

    @teda-t6757

    5 жыл бұрын

    Same here.. :/

  • @teda-t6757

    @teda-t6757

    5 жыл бұрын

    I have found a solution that works for me - it may be the same reason for you. I needed to increase the Jump Force and it worked fine. I think it's because when the force is too low, the play doesn't leave the ground quick enough before the On Land event is called to ground it.

  • @alizlatan4331

    @alizlatan4331

    5 жыл бұрын

    Ted Alden-Templeman it didnt work (And do you know why the idle animation & crouching animation play both at the same time)?

  • @d3athstalker

    @d3athstalker

    5 жыл бұрын

    Did you find an answer to this? The problem roots from the Character Controller 2D script but as of now I can't find a way to stop it from checking so fast EDIT: I actually just implemented something to delay this check from happening so quickly. This is the first thing that came to mind so it might not be the best option but you can download my edited script here : drive.google.com/file/d/1AMkNgVx0mRJHY9Jsiv_r5ifnYBuo7D94/view?usp=sharing I added a delay time variable which can be modified in the Unity Inspector under the Character Controller 2D script. If you use this script instead of the one supplied in the GIT repo it should work for you as well.

  • @MintyBunnyJuniper
    @MintyBunnyJuniper Жыл бұрын

    I appreciate you for keeping your channels on view so that we can see other good channels for this too thank you 😭

  • @ralphcalzada4767
    @ralphcalzada4767 Жыл бұрын

    i miss this channel

  • @amritsahani69420

    @amritsahani69420

    Жыл бұрын

    sameee😭😭

  • @thekiwisedge3498
    @thekiwisedge34985 жыл бұрын

    When I have the Character Controller 2D script open the events show, and I can’t access them. What should I do?

  • @isroelchernetskey

    @isroelchernetskey

    4 жыл бұрын

    in this Prohect New Script

  • @nicholascarson2554

    @nicholascarson2554

    4 жыл бұрын

    You want to press the plus sign and then drag your player movement script inside of your event.

  • @gk1460

    @gk1460

    3 жыл бұрын

    how do i add events?

  • @jood7449

    @jood7449

    3 жыл бұрын

    i am having the same issue now

  • @jood7449

    @jood7449

    3 жыл бұрын

    but i cant see any events at all under the script

  • @watagree
    @watagree5 жыл бұрын

    Hey i really like your content. I don’t know anything about coding and stuff. And I don’t watch your videos to learn but simply because I enjoy them. Game development is so intriguing and it looks really cool. I hope I get a change to actually learn from your videos when I finally get the time. ALSO ARE YOU GUYS FULL TIME KZreadRS OR ARE YOU AN INDIE STUDIO. I ask this because I would really like to see a fully fleshed out game of yours!!!!!!!

  • @SamAlexandros
    @SamAlexandros Жыл бұрын

    Lifesaver! It takes me a lot to time to animate through code!

  • @user-gn7zo1bz5w
    @user-gn7zo1bz5w4 жыл бұрын

    This is exactly what I wanted. thank u!!

  • @MCcoffa
    @MCcoffa4 жыл бұрын

    you.are.the.best... literally saving my school semester XD

  • @monkeyrobotsinc.9875

    @monkeyrobotsinc.9875

    3 жыл бұрын

    Lol, you, lol school

  • @danybeam
    @danybeam5 жыл бұрын

    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

  • @ramadesara

    @ramadesara

    Жыл бұрын

    Thank you so much!

  • @the_glow_board1

    @the_glow_board1

    10 ай бұрын

    I saw it... in 2023

  • @arkadiuszmazurek8898
    @arkadiuszmazurek88982 жыл бұрын

    Bro, I just watched carefully your tutorial and my game has +1 level, thank you :)

  • @Dedglitch
    @Dedglitch2 жыл бұрын

    the only tutorial that actuallly helped me even 2021

  • @zonevaldez9716
    @zonevaldez97165 жыл бұрын

    please help me! Why i need to double press the UP/W key to see the animation of jumping?

  • @sheadex4786

    @sheadex4786

    5 жыл бұрын

    Same for me :(

  • @Kardiiacc

    @Kardiiacc

    5 жыл бұрын

    me to

  • @ethanevans2402

    @ethanevans2402

    5 жыл бұрын

    I think it has something to do with his character controller script. If you look at the FixedUpdate function in his character controller he invokes the on land event whenever the character’s ground check intersects the ground and when the character was falling before that. The problem is that when your character jumps there is a split second where after you’ve jumped, the character’s ground check is still touching the ground, which means the character controller thinks you were just falling and just landed. This is why you can see the animation for a split second before it goes back to idle. Once you’re up in the air and press it again the animation plays because the ground check is far enough away from the ground to not trigger the event. Working on a solution right now.

  • @provensi

    @provensi

    5 жыл бұрын

    here guys private void OnCollisionEnter2D(Collision2D collision) { if (collision.collider.gameObject.layer == 9) { OnLandEvent.Invoke(); } } delete where the another OnLandEvent.Invoke() is (FixedUpdate() i think), in my case the ground layer is 9, so change it if not yours

  • @danielselaru7247

    @danielselaru7247

    5 жыл бұрын

    Well, I did this and it's kind of working :)) if (Input.GetButtonDown("Jump")) { jump = true; animator.SetBool("IsJumping", true); }else if (Input.GetButtonUp("Jump")) { jump = true; }

  • @SuperMrMuster
    @SuperMrMuster5 жыл бұрын

    How do you change your sprites facing? I've been going back and forth in your video, but I can't find the part where you tell Unity to mirror the sprite if the character is moving left. For you, it just seems to work right out of the box. I wrote my movement script before watching this video, so I don't know if you have it somewhere in there.

  • @jonathanzhu6917

    @jonathanzhu6917

    Жыл бұрын

    In the character controller, he uses a method called flip to flip the character depending on the direction its facing (it uses the horizontal input from the user, ie -1 is facing left, 1 is facing right)

  • @nayunis9289
    @nayunis92897 күн бұрын

    Fantastic tutorial!! Thank you so much :-)

  • @kapcioszek2137
    @kapcioszek2137 Жыл бұрын

    Your tutorial really helped me out! Thank you a lot

  • @user-hf4bn9ii9l
    @user-hf4bn9ii9l4 жыл бұрын

    when playing the Moving animation of my player, the animation is playing and everything is okay, but it plays UNDER the player image meaning that the deafualt art is over the animation. The weird thing is that my idle animtion plays just fine, it is a blinking animation and thus I know for sure that it actually overwrites the current player model. Any idea why it's happening?

  • @MagnetiumWoop

    @MagnetiumWoop

    4 жыл бұрын

    It happend to me too

  • @CiaranChan

    @CiaranChan

    4 жыл бұрын

    Have you tried setting your character to a specific Character Sorting layer, and then putting that in front of your background? Try removing all your other assets by hitting the little eye symbol on their left and see if it still blinks. If not, it was a sorting issue.

  • @ceciliacecchet5869
    @ceciliacecchet5869 Жыл бұрын

    If the samples aren't showing up in your unity animation tab, press the three points that are on the corner of the tab (the animation tab) and press "show sample rate"

  • @lurky5913
    @lurky59134 жыл бұрын

    So amazing,you are truly a genius

  • @TB3hnz
    @TB3hnz4 жыл бұрын

    NAILED IT!!!

  • @frannypack8879
    @frannypack88795 жыл бұрын

    Hey Brackeys, been following your tutorials so far and I'm learning a lot through it. I'm currently trying to figure out melee attacks and how to script it. I noticed you didn't have a melee combat tutorial video for 2d games, would you be willing to make one?

  • @isaacwilkerson4057
    @isaacwilkerson40573 жыл бұрын

    im using my own script and was wondering if anyone knows how to add the events to my character controller

  • @georgecobb1466
    @georgecobb14663 жыл бұрын

    Thanks so much for this. I was stuck but this really helped!

  • @omeryilmaz1021
    @omeryilmaz10214 жыл бұрын

    one of the best tutorials thanks!

  • @user-eo5hv
    @user-eo5hv4 жыл бұрын

    There's no 'Player' getting created, so I can't use the player as the controller in the animator component. PLS HELP

  • @ethanrogers2056

    @ethanrogers2056

    3 жыл бұрын

    little late but...Do you mean the animator controler? press "+" at the top of the assets window and add "animator controler."

  • @Ravik-no6wx
    @Ravik-no6wx5 жыл бұрын

    woah nice tut, Im just curious - r u usin' some extension to color ur code or u customize all of it in the vs?

  • @maroc7697

    @maroc7697

    5 жыл бұрын

    I code in vs and (in default) it seems like in video, maybe you have to update it :)

  • @learnunity8487
    @learnunity84874 жыл бұрын

    hey I have been watching some of your videos and it's very helpful thanks man

  • @rubabmubarrat
    @rubabmubarrat2 жыл бұрын

    one of my favourite videos!

  • @eziothegoat
    @eziothegoat5 жыл бұрын

    Please do game saving/loading tutorial!!

  • @AhmedKhalfYolo

    @AhmedKhalfYolo

    5 жыл бұрын

    Just use player prefs

  • @AhmedKhalfYolo

    @AhmedKhalfYolo

    5 жыл бұрын

    He made a video about saving and loading high score

  • @eziothegoat

    @eziothegoat

    5 жыл бұрын

    I mean about saving and loading if you exit the game and you want to continue playing later ..

  • @AhmedKhalfYolo

    @AhmedKhalfYolo

    5 жыл бұрын

    Yea same technique

  • @ererbe

    @ererbe

    5 жыл бұрын

    or you can use save game free (it is very helpful in my eyes)

  • @zaichothepsychoofficial7208
    @zaichothepsychoofficial72082 жыл бұрын

    FOR JUMPING, If you have an animation that is more than one frame long and animation is stuck on first frame do this Click on the transition from ANY STATE to JUMPING --->Untick 'Can Transition To'. this was causing an infinite loop allowing the animation to loop into restarting, staying in the first frame

  • @yuno833

    @yuno833

    Жыл бұрын

    Thank you so much

  • @cecibenitez3917
    @cecibenitez39172 жыл бұрын

    omg!! thanks Bucky the ".anim" extension was missing in my case, thanks!!

  • @gmbalacera6086
    @gmbalacera60865 жыл бұрын

    i love it, just recently bought the aseprite and im willing to make my own videogame, these videos are a lot of help! ♥

  • @starlightakabane4686
    @starlightakabane46862 жыл бұрын

    Thank you so much I actually made a dumb mistake of not finishing the video so I missed all the script parts and had a lot of trouble with it like for a day and then I went back and saw that we had to script and I was literally mindblown bruh. IT WAS SO BAD 😭😭😭 But luckily I finished the video this time and got my animations!!!! TYSM!!!!!

  • @TheLastApplePie
    @TheLastApplePie5 жыл бұрын

    How do you add "Events" on a Script? i didn't use his Character Controller 2D script

  • @Petesails

    @Petesails

    3 жыл бұрын

    I'm assuming you've got this now but for anyone else struggling at the top put - using UnityEngine.Events; then an attribute that says this - [SerializeField] UnityEvent OnLandEvent; then where you want to trigger the event - OnLandEvent.Invoke(); I managed to get the last 2 lines but i couldn't work out where i was going wrong for ages turns out you need to tell is to use the events thing at the top. That is really important aparently.

  • @deepseaking1506

    @deepseaking1506

    2 жыл бұрын

    @@Petesails thank you thank you THANK YOU

  • @Victor-kt6qn
    @Victor-kt6qn4 жыл бұрын

    Someone help!!! My jump animation only plays the fall animation at the peak of the jump. Before the peak it displays the idle animation also after the peak it plays the idle animation.... Help. It looks like my character is having a spasm

  • @j.kkidding9764

    @j.kkidding9764

    4 жыл бұрын

    oh boy.. thats really hard man. I hope you find a solution to it!

  • @franceandson
    @franceandson2 жыл бұрын

    This tutorial was great! Thank you!

  • @xiejames5549
    @xiejames5549 Жыл бұрын

    Animation super cool! Thank your sharing ~

  • @GtsAntoni1
    @GtsAntoni15 жыл бұрын

    Hi there, may I ask a question? You created the event OnLanding, and tied it to the animator. I don’t understand how the engine knows to trigger the event ‘OnLanding’. I’m assuming it’s tied to Speed, or collision detection, but I don’t know how. Same thing goes for ‘IsCrouching’; I don’t understand how being under a collisionbox forces ‘IsCrouching’ to be true. Is there some code for that that is beyond the scope of this video? This is probably painfully obvious to you and those reading, I’m sorry; I’m brand new to this.

  • @NRW-rk8pr

    @NRW-rk8pr

    5 жыл бұрын

    I think those are specified in the code for the character controller

  • @devmelonroblox
    @devmelonroblox3 жыл бұрын

    my jump animation plays for like 0.0001 seconds because it touches the ground when i jump how do i fix this?

  • @gefest9530
    @gefest95304 жыл бұрын

    The best tutrorial, it's great!

  • @JC-rv2tq
    @JC-rv2tq3 жыл бұрын

    IDK if u are reading this but uve been helping a lot with my College work all year long THANKSS

  • @suryamdg
    @suryamdg2 жыл бұрын

    For those of you who only see the Jump Animation for a split second this simple solution might work: *Solution:* Decrease the ground check radius and check if it works properly (if it still doesn't work decrease it even more). This also might not work if you have kept the game object that checks if touching ground too much below the player. *Explanation:* The reason why this is not working is that the program is checking for ground at that very split second of the jump since the program is updating too fast the animation check option keeps returning to false. If you decrease the radius of the ground check then by the time the program checks for ground the overlapping circle would have moved away from the ground due to low radius thus not overlapping anymore. *Don't add Exit time I know it works but the problem with that is it only works for fully flat ground, suppose you are jumping to a level higher than you then the sprite would be touching ground before the exit time is over thus remaining in jump animation for more time in spite of touching ground*

  • @fanaticape295

    @fanaticape295

    9 ай бұрын

    Thank you, this helped a lot!

  • @pastaloverohyeah
    @pastaloverohyeah2 жыл бұрын

    If your jump animation keeps looping, go to your jump->idle transition and change the parameter to "Speed Less Than .01" :)

  • @Sh4dxw20

    @Sh4dxw20

    8 ай бұрын

    Didn't work 😭

  • @ashurgeltv
    @ashurgeltv3 жыл бұрын

    SUPER AWESOME!!! I don't know why everyone is complaining. Everything in this video works fine and I'm making this game in 10/20 using the spaceman animation. All codes and everything else works fine. Honestly you just have to be patient and be able to problem solve. I feel people give up on themselves very easy. Trust me...I spent over 7 hours alone trying to get his crouch animation to work. i erased and rewrote the code...I went back and rewatched the video plenty of times...I am happy to say that yesterday i figured out the problems and I couldn't be more happier. It was a super easy fix which honestly pissed me off. As soon as i got it to all work. I saved the game and closed it. Thanks for everything and I plan to watch most of your vids.

  • @totallyrandompersob1664
    @totallyrandompersob16643 жыл бұрын

    If the jumping animation doesn't work still, maybe try keeping on exit time for when it switches to idle or running. Don't keep Transition time. Only keep it for when it goes from Any State->Jumping. Turn off exit time too on Any State->Jumping. I hope it helps because it worked for me. Not the perfect solution, but it works. EDIT: don't do it it causes a weird glitch if you keep pressing the jump button in midair.

  • @r3ady150
    @r3ady1504 жыл бұрын

    For those who are not seeing the samples option. Maximize the animation window and you should see 2 pairs of 3 dots in top right corner. Select the bottom most one and select show samples. I spent about an hour finding out how to do that one thing. SMH @ unity

  • @claidei0011

    @claidei0011

    2 жыл бұрын

    Thanks! I almost quit after I couldn't find it

  • @henrytai4030

    @henrytai4030

    2 жыл бұрын

    I love you so much

  • @alextashkov2772
    @alextashkov27724 жыл бұрын

    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

  • @yojojo351

    @yojojo351

    4 жыл бұрын

    Thank you

  • @miguelreliquias4407

    @miguelreliquias4407

    4 жыл бұрын

    thanks bro!

  • @mustafaalnaeb1651

    @mustafaalnaeb1651

    3 жыл бұрын

    Thank you so much life saver!

  • @soop6015
    @soop60154 жыл бұрын

    Awesome vid! Rlly helpful comment section too

  • @aminecraftsalmon1645
    @aminecraftsalmon16452 жыл бұрын

    This guy really helps.

  • @benevolent9130
    @benevolent91302 жыл бұрын

    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

  • @matildemonaexe

    @matildemonaexe

    2 жыл бұрын

    omfg thank you!

  • @sophiali220

    @sophiali220

    2 жыл бұрын

    Oh my gosh this literally saved my sanity!!! Thanks for the tip

  • @rama585

    @rama585

    2 жыл бұрын

    woahh thank you!

  • @xavierturcotte7777

    @xavierturcotte7777

    2 жыл бұрын

    I had the same problem and I tried to erase the ! at line 67 , but that made the player uncrouch when stop pressing the crouch button even if there is a ceiling. What I did to solve the problem was to add a new Layer(not sorting layer) called player, put the player in that layer and finally disabling the player layer in the "what is ground" in the character controller.

  • @xigniter7785

    @xigniter7785

    2 жыл бұрын

    thanks a lot you are a saviour!

  • @mauriciocortespersonal
    @mauriciocortespersonal4 жыл бұрын

    is there a way to reuse the same animations (walk, jump, etc) with other sprites automatically? (to change player skins without creating all the animations again) i found a way but it must be a better way.... My way is hard to explain but is like this: - create an empty gameobject ("Player"?) with all the individual sprites in the same position x,y,z - use generic names for the sprites (frame1, frame2, frame3 or idle01, idle02, jump01) - in the animation you want to create (let's say: "Jump") you record and set the parameter Gameobject.isActive to false on all the sprites except the one you need to that keyframe (and repeat) - Done. If you want to create a different "Skin", just duplicate the previous gameobject ("Player") and change the sprites (using the inspector) without changing the names of the gameobjects containing the sprites. - All the animations and animator-controllers can be used with this new skin automatically! if you have 30 animations, you wont need to create 30 more for every skin, just duplicate the first skin and replace the sprites and you're ready! Note: i found there's another way (kzread.info/dash/bejne/eoFlmc96na_KZ84.html), replacing the 2D texture in the lateUpdate, the tutorial is from 2014 i haven't test it yet

  • @PritamDavis

    @PritamDavis

    3 жыл бұрын

    the way you told is pretty impressive, and considering a player wouldnt have more than 30 images, 30 gameobjects also does not put load on the cpu, and also, no gameobjects are created or destroyed, just enabled and disabled... Yeah so ur solution is pretty cool

  • @PritamDavis

    @PritamDavis

    3 жыл бұрын

    Cant think of a better way

  • @thananjaijongrak7604

    @thananjaijongrak7604

    3 жыл бұрын

    I just install Unity and learn C# for like 2 months. So I wonder will my guess be usable? instead of duplicating 30 animators, can we apply with code? like create a pool of library and call the sprite that we actually need for player.

  • @windwakin

    @windwakin

    2 жыл бұрын

    Use an animator override controller my dude. I use it to copy animation transitions without all the extra work because I can just drag and drop the animations and sprites I wanna use in and PRESTO!

  • @cisnerosjerez
    @cisnerosjerez2 жыл бұрын

    Brackeys you are the man!

  • @CulverFromBefore
    @CulverFromBefore3 жыл бұрын

    i love this man

  • @williamr.vazquez619
    @williamr.vazquez6194 жыл бұрын

    How did you create your On Land Event in the "Character Controller 2D" Script?

  • @terramerc733

    @terramerc733

    4 жыл бұрын

    Find out how yet?

  • @emil6176

    @emil6176

    4 жыл бұрын

    To create a event you need to do "using UnityEngine.Events;" in the top of your code. Then what he did was to add this code a little bit under the publics and privates. " [Header("Events")] [Space] public UnityEvent OnLandEvent; [System.Serializable] public class BoolEvent : UnityEvent { }"

  • @mr.potatochipp9289

    @mr.potatochipp9289

    4 жыл бұрын

    @@emil6176 that helped a lot thanks!

  • @solitarygrounds

    @solitarygrounds

    4 жыл бұрын

    @@emil6176 what do you do after that because for me its still not working i have no animation

  • @solitarygrounds

    @solitarygrounds

    4 жыл бұрын

    @@emil6176 to clear it up i cant see my function OnLanding from the function drop down! it is set to public just says No Function

  • @evancarson5301
    @evancarson53015 жыл бұрын

    I need learn more coding and this is a great vid

  • @zaadshadow1279

    @zaadshadow1279

    5 жыл бұрын

    he made a C# series. you should watch it

  • @meersindi3800

    @meersindi3800

    4 жыл бұрын

    jack you*

  • @Tarzy8
    @Tarzy84 жыл бұрын

    Te do el love , u r awesome , u r savin my university proyect

  • @monkeyrobotsinc.9875
    @monkeyrobotsinc.98753 жыл бұрын

    Epic content. I've been hard at work. It's kewl.

  • @abdoudjam6846
    @abdoudjam68465 жыл бұрын

    Thanks a Lot ! yes Please skeletal animation would be so helpful ! ( Like if you agree ) !

  • @thenicksterd2334

    @thenicksterd2334

    5 жыл бұрын

    ?

  • @Relaxing137

    @Relaxing137

    5 жыл бұрын

    yeah,,..,. ?

  • @darkbruhify509

    @darkbruhify509

    4 жыл бұрын

    Sans

  • @xteensgames

    @xteensgames

    4 жыл бұрын

    Cristian the great toast because sans

  • @kandy5129

    @kandy5129

    4 жыл бұрын

    @Cristian the great toast he has to do with everything

  • @Demigodish4o3
    @Demigodish4o35 жыл бұрын

    For some reason the idle transitions to crouching animation without me pressing anything. The "isCrouching" Parameter keeps going On and Off automatically :(

  • @BerlandMedia

    @BerlandMedia

    5 жыл бұрын

    I have the same problem.. Did you find a fix for it?

  • @oooriuken

    @oooriuken

    5 жыл бұрын

    Check if your player has the "Player" layer assigned

  • @BerlandMedia

    @BerlandMedia

    5 жыл бұрын

    Worked for me! Thank you :D

  • @oooriuken

    @oooriuken

    5 жыл бұрын

    Also the attribute “What Is Ground” of “Character Controller 2D” need to have everything selected except for that “Player” layer

  • @harperhejter7766

    @harperhejter7766

    5 жыл бұрын

    I have the same issue. Player is on a player layer , tilemap is on a default layer and "what is ground" have everything selected except for Player layer

  • @yeevon3852
    @yeevon38524 жыл бұрын

    A very good video in teaching. This helps me alot in my journey

  • @rayaqin
    @rayaqin4 жыл бұрын

    this is so awesome

  • @30may10
    @30may104 жыл бұрын

    why my character just look at the direction of right? and pls i need help i used 2D Platform Controller from the asset store and is this made the way wrong? please i need answers

  • @PurooRoy

    @PurooRoy

    4 жыл бұрын

    Add this to your void Update() code- if (Input.GetAxis ("Horizontal") { Vector3 lTemp = transform.localScale; lTemp.x = -1; transform.localScale = lTemp; } if (Input.GetAxis ("Horizontal") > 0) { Vector3 lTemp = transform.localScale; lTemp.x = 1; transform.localScale = lTemp; }

  • @jennajaillet6942
    @jennajaillet69425 жыл бұрын

    So I noticed when my character jumps all is well, however when my character just walks off a ledge, the idle animation continues to play. Any thoughts on how to implement a fall into the code. (Sorry, I'm new at this but very excited to learn!)

  • @ashtimbo

    @ashtimbo

    2 жыл бұрын

    You could create a new animation strictly for falling then create a bool that turns on when falling and not jumping and then set the idle animation to transition to the fall animation when the bool is set to true

  • @someobscuremusicchannel

    @someobscuremusicchannel

    2 жыл бұрын

    @@ashtimbo whpa 8 hours ago

  • @Liquid23

    @Liquid23

    2 жыл бұрын

    @@someobscuremusicchannel lol 3 hours ago

  • @someobscuremusicchannel

    @someobscuremusicchannel

    2 жыл бұрын

    @@Liquid23 ee 14 minutes ago

  • @Liquid23

    @Liquid23

    2 жыл бұрын

    @@someobscuremusicchannel hddeuebhe 2 minutes ago

  • @AlicesWhoRuHouse
    @AlicesWhoRuHouse4 жыл бұрын

    Thank you so much for this video I learned so much! Going to school to learn to code was never something in my realm of doing sadly but I really wanna try my hand at making a game and your tutorials help so much! So I have a question say that I wanted to make a game not like stardew valley but like stardew valley? Meaning I don't want to copy the game but game components wise the isometric view, the fishing aspect, the combat aspect, the quests and scenes, the farming. I like all the individual things that make up stardew so say I wanted to learn them all one at a time for a visual learner cause I learn better by watching it get done how would I go about learning? Do you recommend any videos to get me started? Could you make individual videos on the small aspects of stardew valley to help me and many others learn one by one? Again thanks for your videos they really help me alot!

  • @joecraft9098
    @joecraft90983 жыл бұрын

    Thanks Brackeys!

  • @TheEpicplushgod
    @TheEpicplushgod2 жыл бұрын

    I am unsure why but when I do this for my own sprites for my game when I press play in the animation window it does not change the sprites at all, does anybody know why this is happening or a way to fix this? If so that would be very helpful!