Animation Layers in Unity - Explained

Поделиться
HTML-код
  • Опубликовано: 10 фев 2025

Комментарии •

  • @AbsoPrime
    @AbsoPrime 7 месяцев назад +3

    This one truly kickstarted my dive into the next level of animations in unity, thanks man!

    • @anandev
      @anandev  7 месяцев назад

      Yay! I'm glad I could be of help! 🕺🏻

  • @jeanlsm3227
    @jeanlsm3227 8 месяцев назад +4

    you deserve so much more views and subscribers! you just saved my gamejam!

    • @anandev
      @anandev  8 месяцев назад

      Awww! Thanks this means a lot! Would love to check out your game jam project if it is online!

  • @jumbocube
    @jumbocube 2 месяца назад +2

    Great video, very positive, lots of knowlege :)

    • @anandev
      @anandev  2 месяца назад

      Thank you for the love ♥️

  • @omlachake2551
    @omlachake2551 8 месяцев назад +2

    You dropped it at the perfect time!! Thanks

    • @anandev
      @anandev  8 месяцев назад

      Yay!! I'm glad the video was useful 😸

    • @omlachake2551
      @omlachake2551 8 месяцев назад +1

      @@anandev Would you be able to link some articles or blogs for us to read to move beyond the "cheat code", so we would know what to do when shipping actual games? Thanks!

    • @anandev
      @anandev  8 месяцев назад +1

      @@omlachake2551 Sorry I couldn't reply sooner, I didn't get notified of your reply :(
      I personally learned all of these things from here and there and through my 6 years of playing around with the engine.
      I would argue the best thing to do is to actually ship games, and see what works for you.
      Using Layers is purely meant for separating animations based on different body parts, and mostly nothing else. There's more we can do with Sub-state machines (An advanced approach will be shared in the upcoming video, please watch it if you can when it comes out, and let me know if it was helpful) and Run time controllers, and even manual Cross Fading through Code.
      Because there is no "one right way" to do it, it is really difficult to link you to a direct solution, because it doesn't exist. However, you should definetely consider Unity Learn, and some Udemy online courses. When it comes to animating things, I think experience is the best teacher. I think as long as the player experience doesn't get disturbed, anything works. Hope this helps!

  • @Director414
    @Director414 4 месяца назад +2

    great video! thanks bro!

    • @anandev
      @anandev  4 месяца назад

      Thank you! I'm glad you liked it!

  • @webergamedev
    @webergamedev Месяц назад +1

    Beautiful

    • @anandev
      @anandev  Месяц назад +1

      Thanks! 😊

  • @mrjey2417
    @mrjey2417 8 месяцев назад +1

    keep the great tutorials going ... thanks 🥀🥀

    • @anandev
      @anandev  8 месяцев назад

      Thank you! This means a lot!

  • @boyar3033
    @boyar3033 7 месяцев назад +1

    Thanks !

    • @anandev
      @anandev  7 месяцев назад

      You're Welcome! I'm glad the video is useful!

  • @stanleye.minnickiii114
    @stanleye.minnickiii114 6 месяцев назад +1

    Thanks so much for this well produced video! Is there anything significantly different working with 2d animations here, or will the same principals and techniques apply?

    • @anandev
      @anandev  6 месяцев назад

      Aw! This means a lot!! I'm glad the video is useful! 🥰
      For 2D, Layers don't really matter for frame-by-frame hand-drawn art. However if you are doing 2D Character Rigging, then Layers can be used, however the concept of Avatar Masks won't be of any use. So I recommend not really bothering with Animation Layers in 2D. It's not really worth it, I think.

  • @TheTrolderia
    @TheTrolderia Месяц назад +1

    But how do you use the weight of the layers? So if i walk and i right mouse click, i want to use my next layer to point a gun, and if i unhold right mouse click the weight should go down again? Like how do i use it practical in code or anything else?

    • @anandev
      @anandev  Месяц назад +1

      You can use the Animator.SetLayerWeight() function in code to change the layer weights. But you should interpolate the weight value, to get the smooth results.
      For pointing a gun, there are multiple ways you can do it. You can create a new layer for combat, and use Avatar Masks on it to filter out parts of the body. Then you can change the layer weight as you have suggested.
      Another way would be to procedurally animate it. Use the rigging package and use IKs on top of existing animations and override it. You animate the hand IKs via code when you are right clicking.
      Another simple way would be to create an entire animation for it, and then just transition to it.
      There is no right way to do it, but using layer weights is just so easy and straightforward. Make sure to set the layer to additive. Hope this helps! Let me know if you need further clarification!

    • @TheTrolderia
      @TheTrolderia Месяц назад +1

      ​@@anandev Holy shit, thank you for such a great, fast and many optional reply! I will look further into it!
      And great video btw!

    • @anandev
      @anandev  Месяц назад

      @@TheTrolderia Thank you so much for the kind response! It means a lot! Also, glad you liked the video!

  • @AbGaming-oq1hk
    @AbGaming-oq1hk 8 месяцев назад +1

    its Better if you Teach in Hindi

    • @anandev
      @anandev  8 месяцев назад

      I appreciate your suggestion. I do speak Malayalam and Hindi, but choosing English was a personal choice, and it's accessible to more people 😊 Thank you for the suggestion