Why you should use code to animate your UI in Unity.

preview_player
Показать описание
In this video we take a look at why you shouldn't animate your UI and why instead, you should be using a Tweening Library like Lean Tween!

Be sure to LIKE and SUBSCRIBE if you enjoyed this guide! Share the video for extra love!

Рекомендации по теме
Комментарии
Автор

Jesus christ the production level of this video is incredible.

RumpledCode
Автор

Important stuff:
If you are going to use LeanTween to animate your UI, dont pass the GameObject itself to the LeanTween Methods, instead, pass the component RectTransform. If you pass the GameObject, it will not just mess up the animation (by not following the exact coordinates that you give it) but also it wont work if you change the proporcions of the pantalla.

As an example : LeanTween.move(Panel.GetComponent<RectTransform>(), new Vector3(0, -74, 0), .2f);
Instead of just passing the GameObject.

darcking
Автор

when you spend 30 hours programming in your own tweening library because you don't know they already exist

His-Games
Автор

I have no idea how this is the first time I've seen you channel. The quality is among the very top! Thank you for your work.

demetresaghliani
Автор

Certainly looks a lot simpler than the multitude of animations I've had to create for my games UI. Cheers for the library showcase :)

simoncodrington
Автор

Nice stuff, nice production, nice volume levels!

insomnious
Автор

Literally the "Mumbo Jumbo" of Unity. Great tutorial!

spxctreofficial
Автор

I love tweens and they are very powerful, however, I must say that they are really not artist friendly (by that I mean someone whose job it is to make something look nice with 0 experience in code). Yes, some of those libraries have visual editors, but I have yet to see one that is as easy to do something complex as the default Unity way. Personally, I've worked on dozens of games at a big company and our UI has never been a performance drain. Of course, if your game is top of the line and you need every bit of power to make that AI remain fluid, then go ahead, cut where you can afford, but for the majority of devs, especially indies, the default way is good enough.

That said, the new UI workflow is a lot more performant. It does not fully support animations yet, but let's hope that once they integrate it, they will fix those issues!

joaniepepin
Автор

Don't know why I JUST found your channel but it took me 0.3f to hit subscribe.

IOSoraOI
Автор

This might have been mentioned before, but there's no reason to use tween over Animator anymore :)

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

This has been tested, there's no performance gain over using Tweens. It would be nice if the creator mentioned this in an edit or something so that people wouldn't have to bother with Tweens for no reason.

martinmesserschmidt
Автор

Looks pretty cool, as a programmer I hate doing UI stuff and putting up motion clips, transitions and all that jazz. But obviously I know it's needed to deliver a good product. These tweening libs would make it much easier for me as I don't have to hassle with all the pretty animation clips and 50 animator controllers etc. I'm pretty sure it's also possible to extend the library and write your own custom transitions.

MasthaX
Автор

Short, sweet, and to the point. Perfectly explained, brilliant editing, and EXACTLY what I searched google for. Thank you so much!

brannanvitek
Автор

This is the valid approach for this job. Thank you for this explanation.

Eriadel
Автор

I used to tween(iTween), then I used Animations, now I use tweens again(DoTween).
Now I know what needs tweening and what needs animations.
(heavy complex motions with sound effects syncing, animations, simple bounces and transitions tweening!

Managing transitions from every state to every state with animations was REALLY tedious!
imagine having to move a button and now you need to move it in every transition animation!

HAWXLEADER
Автор

man, how come you don't have millions of subscribers? you provide amazing content! keep strong my dude <3

lcjqhir
Автор

Thanks for telling me about leantween, I have been breaking my head trying to achieve the same effect with coroutines and now I have a solution

SamarthCat
Автор

You perfectly made me interested in the thing I've not heard about 5 minutes ago, while I'm pretty apathetic. Congratulations

squidwardfromua
Автор

Loving your videos so far. Format is perfect, volume is perfect, very nice flow and easy to follow. Keep it up!

DylanBurke
Автор

I am using DoTween for years and now, when I thought I was doing it wrong and I had a plan to try move to animation, you are telling me that I should not do it :D

The only downside is that you did not shared the most important part 3:57 - the actual code of effects you demonstrated at the end.

rickloyd
Автор

Thank you soo much. I was so tired messing with animation curves and 0...1 timers with deadzones! This saved my life ahaha

Studio-dfge