Escaping Unity Animator HELL

preview_player
Показать описание

0:00 Escape Unity Animator Hell
4:48 A practical example & Tutorial
5:55 Sample code overview
8:28 integrating the state changes
16:18 final tutorial outcome

Other tutorials and videos you will like:
How I fixed my game's animations! | Unity Game devlog
Shooting bullets and enemies in unity:
4 Ways to Code 2D Player Movement in Unity
Advice for Game Dev Beginners:

The Unity Animator system is powerful but can quickly over-complicate simple animation state management for 2D games. In this video I will explain to you another, more streamlined approach.
Player Controller Project Files:

#unity #gamedev #tutorial #tips
Рекомендации по теме
Комментарии
Автор

Not all heroes wear capes...sometimes they just have a super clean animator tab. Thanks for the tip!

deadbroadcastpc
Автор

Dude your videos are a gold mine. I'm trying my best to understand the code as I watch all these different tutorials so I can expand and fix, but you take your time to talk about why things work etc, and it's really helpful!

VideoGameAnimationStudy
Автор

I don't think I've posted a comment in nearly a decade but I had to for this. My main character has 114 animations (thank heck he's nearly finished) and HAD over 2500 transitions between them all (and I was originally planning to add more conditions to each transition to iron out any hidden glitches). It took me a few hours to adapt your solution to my extreme example of animator hell, but it actually WORKED. Now I won't have to worry about all those in the main character and all future characters I make! You've probably saved me literal weeks of work once it all adds up. I can't thank you enough. Time to finally relax with some Super Metroid

Nintendosaiyan
Автор

This video is invaluable. I struggled with "Mechanim" throughout my development of Cataclysm, and the complications it caused (due to me using it incorrectly) had a real influence on whether or not I'd go forward with some experimental idea related to animation. It often just wasn't work the risk of messing up the precarious mess that I had.

Right towards the end of development, when I was making some simple animations for the tutorial pages, I decided to just roll my own animation script using coroutines. It has its own limitations, and possibly problems that I have yet to encounter, but it works and (more importantly) I understand it.

If I had your video a few years ago, I could have saved myself the trouble. I sincerely hope that no other noob developer has to deal with the Mechanim cobweb with this video as a guide.

MoonJellyGames
Автор

I always wanted a more code oriented youtuber for learning Unity. It is funny how I can find videos saying "Make games without coding" but no videos saying "Unity but only coding". Also, I always preferred co-routines, but with this approach, I may try the animator, and things may become better. Thank you for the video. :)

victorvallejo
Автор

For those who are using 3D, I find using State Machines and layers and then create logic in code that blends between layers for more complicated animation systems.

Pro-tip you can use an empty state on a higher up layer as a means to turn that layer on and off as well. For example a layer dedicated to climbing and an empty state within it for when you're not climbing, this way you can use the transition to blend from your base layer to the climbing animations without having to do it through code.

SuperJohnsmith
Автор

It's taken me days to watch through this video but even ten minutes in this has revolutionized my animation code in my project. Fantastic video, thanks a lot!

dirtywhitellama
Автор

Just wanna say a big thank you after watching how to navigate through the animator with so many animations! Great content. One suggestion for those who are still interested in further cleaning the code, you may refer to an enum, or more elegantly, state classes for each state with private fields kept (like previous states, animation length, etc). I first found a detailed description of this pattern in Nystrom's "Game Programming Patterns" and the idea came to me that I could really use this Megaman example to practice it.

juanx
Автор

I really like the idea of introducing finite state machines to help control actions/states exclusively, it gets better in the long run than the tangle of ifs.

LuizMoratelli
Автор

I haven't been in the "Game" long, so my projects never required excessive animations. Now that I'm moving up in the world, this tutorial is a godsend. You spoke directly to my soul when you showed me how to escape Animator OCD and spider webs.

Thank you for everything that you do. Anxiously awaiting the release of Blood and Mead!

dtsprogramming
Автор

Mate, great video. As a full time software engineer just getting into unity and c#, it’s these kind of tips that I’m looking for, and intro courses only tend to give the basics. Keep em coming!

Richard-zsbm
Автор

You are a literal HERO! I just finished my first, small Unity 2D game and everything was working perfectly and smoothly except for mothereffing animations! This is exactly what I’ve been looking for, thank you!

milenamazzeo
Автор

It took me years to escape Animator hell on my own, THIS VIDEO IS A GOD SEND, I wish it was out years ago.

DennisDenchoDenchyaknow
Автор

I'll just casually and quietly change my entire mentally about animations in unity. Thank you.

citizengoose
Автор

This actually helps me quite a bit. I was having trouble with cases that the animator didn't cleanly cover, so it's nice to know I can actually just do it myself.

Sluppie
Автор

Thanks so much from Germany for this! The only thing I was missing was how to smoothly transition from one animation to another (using animator.CrossFade) in an equally smart way like you determined the delay time for the next animation

beng
Автор

Like another commenter mentioned you are quickly getting into an if/else nightmare. I would highly suggest people watch UnityLearn's - Finite State Machines by Marc Gilbert which specifically uses a similar animation example starting with your approach before changing into a Finite State Machine. Obviously in your example things are still a manageable but with a few more mechanics it could quickly get to become a nightmare, which I've personally experienced before.

langlearnkorean
Автор

Wow! I just did this on my little sandbox game and it worked. Thanks so much, this is a fantastic approach to animations, I wish you great success on Blood & Mead.

washburnlane
Автор

This has been incredibly helpful and simplifies animations so much! Thank you

rnslicious
Автор

For anyone wondering, this works in 3D games too, you just can't use blend trees, meaning the start and end for ALL your animation clips must be the same pose for it to look natural.

bluebananalab