Create UI ANIMATIONS without ❌CODING❌! - Unity UI tutorial

Поділитися
Вставка
  • Опубліковано 4 лют 2025

КОМЕНТАРІ • 86

  • @CocoCode
    @CocoCode  3 місяці тому

    Want to learn how to create advanced UI animations?
    👉 Check out my newest course, Master Unity UI ➡ bit.ly/cc-unity-ui-32
    It’s packed with everything you need to create awesome UI ✨🎨

  • @Darkaby0Renee
    @Darkaby0Renee 3 роки тому +14

    Easiest animation tutorial I've watched so far. What's great is that it doesn't only apply to UI elements but also gameobject in your scene. Thank you very much!

  • @ThomLaurent
    @ThomLaurent 3 роки тому +57

    Using animation like this in your UI will have a big performance impact because even when in idle each frame the animator updates components animated fields which causes a canvas redraw (its even worse when using LayoutGroups)
    A fix would be to disable the animator (using an StateMachineBehaviour for example) when in idle to re-enable it when you want to animate

    • @andreas1416
      @andreas1416 2 роки тому

      Do you have any numbers to quantify what "big" means?

    • @ThomLaurent
      @ThomLaurent 2 роки тому +4

      @@andreas1416 It totally depends of how complex your UI is, btw I work on mobile so maybe on pc this is not a problem at all. I would say do what's quicker for you then profile and if it has no noticeable impact go next

    • @touzimsky
      @touzimsky 2 роки тому +7

      From the patchnotes In Unity 2019.3: "UI: Fixed performance issues with Animation by not dirtying the Layout if an Animation updates items.
      "

    • @MarcosTeles-x9o
      @MarcosTeles-x9o Рік тому +4

      It is important to note that the performance impact of the Animator can vary depending on the complexity of the animations, the number of animated objects, and the hardware on which the game is running. In many cases, the performance impact may not be significant enough to justify disabling the Animator completely. If you are using Unity 2019.3 or a later version, this fix should help improve the performance of animations in the UI when using the Animator.

    • @moonymachine8125
      @moonymachine8125 Рік тому

      You can also set the animator up to point to an animator state with no animation as the default entry animation. Then you can add states that animate and go back to no animation. You can then play any animation states directly with Animator.Play(). I haven't profiled the performance comparison, but I imagine that it solves some of the performance issues with dirtying the UI canvas.

  • @elmetiu
    @elmetiu 2 роки тому +2

    I swear i love your videos, your style thumbnails, video content they are all fantastic keep doing this!!

  • @ALIALNAQEEB
    @ALIALNAQEEB 3 роки тому +30

    and the new brackeys has emerged

  • @moonymachine8125
    @moonymachine8125 Рік тому

    This is also how you can easily animate 2D sprite sheet animations in your UI. Excellent video!

  • @loizosrr
    @loizosrr 3 роки тому +2

    The best understanding animation/animator tutorial I ever watch !
    Thanks 👍

  • @coolsai
    @coolsai 3 роки тому +1

    thank you very much 💖 currently i am working on a math game and this animation helps me to make game more awesome ⚡

  • @MrFarkasOfficial
    @MrFarkasOfficial 3 роки тому +3

    awesome video! i have used both methods: animator transitions and scripting lean tween transitions. if you're not afraid to code, i think the scripting method is cleaner and it's easier to fix things if you don't like how something is looking. the animator method is very good if you're used to making animations and animating, but if you're just getting into it, it can be pretty overwhelming sometimes because you're working with so many seperate animations that you have to create manually that you then have to combine, edit, and transition to. but i think this really is one of those things that you just choose which one you like more. or you could even combine them.

    • @CocoCode
      @CocoCode  3 роки тому +1

      Exactly!
      I'm aware that the second example with transitions might be a bit complicated, but I tried to show a real game scenario!
      I think the animator is perfect for animations shown on the example with the stars - with the multiple objects.

    • @MrFarkasOfficial
      @MrFarkasOfficial 3 роки тому +1

      @@CocoCode you did an excellent job with this video because you showed what the animator transitions are really good at. i didn't know that you could edit the curves, by the way! that's a gamechanger! i was adding the ease effects manually like a peasant.

    • @AnkitSingh-wq2rk
      @AnkitSingh-wq2rk 3 роки тому +1

      @@MrFarkasOfficial main issues i face using animation is animating ui for dynamic screens and linking in scripting based everything stays in script and you have almost full control over it there itself ... for animator you have also keep track of linking things and adding proper animation events that too with raw string/data which is kinda error prone

    • @MrFarkasOfficial
      @MrFarkasOfficial 3 роки тому

      @@AnkitSingh-wq2rk that's true

  • @tomatogogo
    @tomatogogo 2 роки тому

    I was looking for how to make Animator state do once only , then I found this video, which solved a big problem! grateful!

  • @asila2652
    @asila2652 Рік тому +1

    The new brackeys we all needed

  • @krasimirzhelezov
    @krasimirzhelezov 2 роки тому

    The only good tutorial for UI transition animation

  • @sorixgameyt920
    @sorixgameyt920 3 роки тому +4

    Best tutorial

  • @koganboss4874
    @koganboss4874 3 роки тому +2

    Very good tutorial. Easy to understand=) Thank you.

  • @jeremaineramirez5475
    @jeremaineramirez5475 3 роки тому +4

    THIS IS WHAT I NEED, THANK YOU VERY HELPFUL

  • @arianawells673
    @arianawells673 3 роки тому +2

    I'd like to thank you so much for doing this video. this saved me like you have no idea

  • @ahmedaqeel636
    @ahmedaqeel636 3 роки тому +1

    Pro I don't complete the video because internet so bad but I trust you are the best

  • @arda9310
    @arda9310 3 роки тому +1

    I just wanted to say i was here from 600 subs

  • @simple_6230
    @simple_6230 2 роки тому

    Thank you so much Coco! Your tutorials are so great!

  • @Vinaykumar-bf8hj
    @Vinaykumar-bf8hj 3 роки тому +1

    Wonderful Voice and Tutorial

  • @worldsedge4991
    @worldsedge4991 3 роки тому

    Hello. Thank you for this tutorial. I happened to look for it when I wanted to animate three gold stars at the end of my game levels... And, hey! Look at that. It's just like one of the examples. I look forward to incorporating some of these ideas into my game.

  • @viktorbobrovsky3632
    @viktorbobrovsky3632 Рік тому

    Nice tutorial, but where is the moment when you assign some trigger to the button "Start animation" at the last part of the video? You just created the animation with stars and disappearing the panel with adding an event, so how does it listen on your clicks on the button? Though thanks a lot! Maybe i missed something...

  • @d1kiywolf
    @d1kiywolf 3 роки тому

    Very great and simple tutorial! Thank you from Russia!!

  • @SxAxNxO_Gaming
    @SxAxNxO_Gaming 3 роки тому

    One thump up is not enough. Thx for your videos 👍

    • @ItsSunnyMonster
      @ItsSunnyMonster 3 роки тому +1

      yea same I want to spam the thumb up button just to show how much I appreciated him :)

  • @sohankaushik7
    @sohankaushik7 3 роки тому

    Best tut for beginners, but also it's not recommend to change UI by animation!

    • @CocoCode
      @CocoCode  3 роки тому

      Hey! Check out my other tutorial where I show how to use tweening library 🐬

  • @ColdOneK
    @ColdOneK 3 роки тому +5

    Not a bad tutorial, but watching it gave me a much better idea.
    The problem: An "idle" animation causes Unity to be forced to redraw the canvas EVERY frame. Why? Even though it might not be changing visually, it is STILL technically animating.
    Solution: Add a script that enables & then disables the Animator component when the animation is complete.
    It will stay on the last active frame. I was about to go through the process of learning one of the tweening libraries(I still need to), but this way is much better, because the Animator is so easy & powerful to work with.

    • @qqq9542
      @qqq9542 3 роки тому

      awesome man. But if I follow the video above, does it impact performance on the device?

    • @ColdOneK
      @ColdOneK 3 роки тому

      ​@@qqq9542 - Yes. Both achieve the same goal with different methods.

  • @amirhassan8271
    @amirhassan8271 Рік тому

    Good tutorial nice method of teaching.

  • @MrRomainlalire
    @MrRomainlalire Рік тому +1

    Love the tutorial, but I have an issue : if you click two times on Open (for example) it stays on that state and it I click on Close when it's blocked, it plays the animation and go back to the other. Is it a way to fix that?

  • @progamerattack8703
    @progamerattack8703 Рік тому

    Thank you that was bretty help full to me🥰🥰🥰🥰

  • @neHCuoHEpa8888
    @neHCuoHEpa8888 3 роки тому +1

    That is good tutorial for something that you don’t need. Instead you can do the same thing with 1 class and around 10 lines, with really much more control and easy way to redacted if need. Also the work with animation is really confusing.

    • @CocoCode
      @CocoCode  3 роки тому +1

      Hey! Be sure to check out my other tutorial that talks about exactly that:
      ua-cam.com/video/YqMpVCPX2ls/v-deo.html

  • @Aleksandar_Dimitrov
    @Aleksandar_Dimitrov 4 місяці тому

    How to use one button to open and close the inventory. Is it possible?

  • @anttipylsymusic
    @anttipylsymusic 3 роки тому +1

    Thanks for this.

  • @zerblion
    @zerblion 3 роки тому

    Wonderful bro,Thank you verymuch!

  • @milosmml7777
    @milosmml7777 2 роки тому +1

    I don't understand the whole point of having a closed animaion and an idle one where the ui just stands still. Why don't you just turn the looping off in the assets of that specific animation. Your animations tab will look a lot cleaner rather than a spideweb mess.

  • @vicente7938
    @vicente7938 3 роки тому

    Thank you for this!

  • @suicune2001
    @suicune2001 7 місяців тому

    Amazing!

  • @tenorgames
    @tenorgames 3 роки тому

    This is so good. Subbed.

  • @ravenace8485
    @ravenace8485 9 місяців тому

    I don't understand how you're able to mask the inventory system, I'm kinda upset because as a beginner I'm stuck at this step.. I even watched your mask video too

  • @AIArtistNoahC
    @AIArtistNoahC 8 місяців тому

    thank you so much. I got U :D

  • @EasyPoker
    @EasyPoker 2 роки тому

    When I set the animation to idle in the animator, the first animation does not show. When I delete the idle the animation loops again. Any idea of why this happens?

  • @andierahmatdiansyah49
    @andierahmatdiansyah49 3 роки тому

    how to create animation when game is over? like the game show game over panel with animation, i have problem when the game show game over panel, but the game still not freeze.

  • @macaaris1018
    @macaaris1018 3 роки тому +2

    Nice👍

  • @sparklydavid
    @sparklydavid 2 роки тому

    Thanks

  • @ValentiBruno
    @ValentiBruno 2 роки тому

    thank you very much

  • @marcdirian6370
    @marcdirian6370 2 роки тому

    HI
    Love your tutorial but..... What UNity version do u use ? With Unity 2020.3.33 when I use Animator my unity. application crash everytime.. 🙂thank's

  • @mimobenslimen7035
    @mimobenslimen7035 Рік тому

    @12:22 that is wrong, do not use Canvas group for individual objects, you can just use the image alpha. a canvas group require a GROUP of children.

  • @ThomLaurent
    @ThomLaurent 3 роки тому

    You have an Image to fade in/out, so why not using its color alpha?

  • @johnnyrod328
    @johnnyrod328 2 роки тому

    Game object with animator is inactive
    UnityEngine.Animator:Play (string)
    Anyone knows what is wrong with my animator?

  • @MrGuluere
    @MrGuluere 3 роки тому

    Lifesaver!

  • @rijufrancispk4803
    @rijufrancispk4803 3 роки тому

    How to use that same pouch bag icon to close the inventory, anyone please help?

  • @liualex32
    @liualex32 3 роки тому +1

    nice video

  • @JaviCoder
    @JaviCoder 3 роки тому

    nice video!, what about performance? i havent tested but according to Unity, "Animators will dirty their elements every frame, even if the value in the animation does not change", which results in a redraw (60fps)

    • @CocoCode
      @CocoCode  3 роки тому +1

      That is a great question! Check out the video description for more details. I’ll do my tests about that and will update it if I’ll find something more

    • @ColdOneK
      @ColdOneK 3 роки тому +1

      I figured out a solution. Just disable the animator component after the animation completes.

  • @lidjest9888
    @lidjest9888 3 роки тому +1

    Очень классный урок

  • @pladooklocal7094
    @pladooklocal7094 3 роки тому

    i love your tutorial, Thank you

  • @GreenGuru23
    @GreenGuru23 10 місяців тому

    flame!) thanks

  • @bajusztibor6232
    @bajusztibor6232 3 роки тому

    TY

  • @RockLiu-b2l
    @RockLiu-b2l 3 роки тому

    awesome

  • @wylmalucia3353
    @wylmalucia3353 Рік тому +1

    Maravilhoso!

  • @Ostavnow
    @Ostavnow 3 роки тому

    I did not like the video that you have created as many as 4 animations, when you could create one.I explain how it can be done, do one animation of the panel opening, then do the settings that it is not repeated, make a condition such as bool, copy our animation in Animator ctrl + d (in the files will be only one animation) now change the copied animation speed to -1 and connect them arrows, and then you know how to do

  • @AnthonyRosenbaum
    @AnthonyRosenbaum 3 роки тому

    FYI using the Animator is VERY expensive and highly unrecommended for simple animations

    • @CocoCode
      @CocoCode  3 роки тому +1

      Hey! This is why I also created different video where I show how to animate your UI using lerping: ua-cam.com/video/YqMpVCPX2ls/v-deo.html

  • @fv4202x
    @fv4202x 2 роки тому

    animations much better

  • @nTu4Ka
    @nTu4Ka 3 роки тому

    Ко-ко-ко

  • @emreyasar5454
    @emreyasar5454 3 роки тому

    +1

  • @FWpapo
    @FWpapo 2 роки тому +1

    Never animate ui using unitys animator..

    • @Distriks
      @Distriks 9 місяців тому

      Why?

    • @FWpapo
      @FWpapo 9 місяців тому +1

      @@Distriks it had big performance impact thou in unity 2019 they "fixed" it but its still no good practice. That fix isnt perfect.

  • @igd1591
    @igd1591 3 роки тому

    The Animator component is not recommended for the UI.
    unity.com/how-to/unity-ui-optimization-tips