Using IMPROVED Animation Events in Unity

preview_player
Показать описание
Unity Animation Events are useful but can be cumbersome to manage manually. In this video, we’ll show you how to enhance Unity's Animation Event system for better control and flexibility. You’ll learn how to use StateMachineBehaviour to trigger UnityEvents directly from animations, and how to preview animations in real-time within the Unity Editor. We'll also cover automating T-Pose resets for easier rigging and debugging. This tutorial will help you simplify event management, improve efficiency, and streamline your workflow for more complex animation scenarios.

NOTE: Check the repository for AnimationEvents from BlendTrees added after the video.

Want to support me? 😀

#unity3d #gamedev #indiedev

▬ Contents of this video ▬▬▬▬▬▬▬▬▬▬

0:00 StateMachineBehaviour
2:29 Animation Event Receiver
5:00 Custom Editor
11:00 Enforcing T Pose
13:26 Toggle Animation Preview

More Useful Code:

Assets Shown In This Video (Affiliate Links)

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

Happy Sunday! 🎉 Let's make an improvement on Unity's Animation Event system today! Check the repository for AnimationEvents from BlendTrees support as well.

git-amend
Автор

This is the best unity channel on YouTube.

ZacharyYates
Автор

Hey, I'm happy to see someone finally using StateMachineBehaviour! Would love to see you do a followup for everyone about extending ObjectPreview so those state machine behaviors can draw a preview of the animated character just like the Animator transitions do, without requiring modifying the scene character, and controlling that one's timeline.

Yoraizr
Автор

I found it inconvenient to add animation events in AnimationEditor, so I created an animation wrapping class using ScriptableObject. I now see there's a way to add it directly to the state. Thank you for the helpful video.

hotphe
Автор

Honestly, having watched a ton of youtube tutorials over my gamdev career, I can't think of better educator than you! Well explained, to the point, easy to follow. A+ 👌

herpenderper
Автор

I'm just watching the whole video in one gulp! Very clear, without water and at a high level! I can't wait for you to start coding shaders;)

AlexanderSholk
Автор

Just starting to work on my first game in unity. Definitely a challenge with a full time job but your tutorials are fantastic!
Was just looking into animations as well 😊

jb-ljcj
Автор

I just discovered this channel, and the comments I see are very positive. I see why, bro. This right here is the truth. I am now a faithful subscriber!

indianapapi
Автор

git-amend reached into my brain and made a video helping with what I was currently struggling with.

stephanedurette
Автор

I am grateful for all the information you've given me but I can't help but be discouraged at the same time.
You are insane. Every video I watch there is an ocean of information to take in. I was already satisfied at 4:50, but clearly you were not, and you went on to adjust InspectorGUI and HumanBodyBones. I didn't even KNOW that HumanBodyBones even existed. I didn't even know that I wanted all this before you showed it, and now it feels like a requirement.

I thought knowing couple of common design patterns and a decent understanding of SOLID was enough for me to code efficiently, but there is so much knowledge out there that I don't know.
If I'm trying to break into the video games industry, is this the level of Unity/C# (in your other videos) understanding I need to be competitive? Have I been doing nothing the past year?

panik

SomeKrnDude
Автор

Great content as always! Thank you for consistently creating such amazing videos every week!

nhatlinhtran
Автор

This is fantastic and very timely in my case. This week, I've literally been going though and doing all those annoying tasks to make animation events manually.

dustintaub
Автор

Definitely the best channel for those who want to learn intermediate and high level developing skills!

One thing I don't like about unity's state machine behavior is that, if there are two states blending between each other, the second state's OnStateEnter will actually be called before the first state's OnStateExit, this can cause bugs when script logic is highly depending on the animation's begin and end. (luckily, thx for git-amend's better state machine video, I extend that one to split the game logic and animation, really save my life)

谢威-kd
Автор

This is great! I always hated how Unity handled these animation events, not only setting it up was painful but also you had no way of knowing before hand if that clip had an event inside it. You could easily forget when changing animation clips for better ones actually to setup the events again. Storing it within the Mechanic State Machine is definitely a better approach.

INeatFreak
Автор

Thank you so much for this, cumbersome is too polite a word I would use for Unity's animation system. I used AnimatorStateInfo to keep track of when animations were at varying points for things such as attacks or when I wanted logic to transition animations because Unity's Animation Event system either was too buggy or didn't respond at all when you wanted split second triggers. Love the addition of the custom editor!

silchasruin
Автор

perfect for what im doing keep it up, unity needs to hire you, best tutorials around

Haze_E
Автор

video is gold. appreciate everything you do for us :D

metaling
Автор

Your channel is a godsend. Thank you for sharing your expert knowledge.

prometheus
Автор

holy manoly, these was the one I needed just as this moment

henrikekholm
Автор

Cool and useful video - as always)
I tried this approach and discovered two interesting things:
1) The script can be slightly modified so that it takes all the sub state machines that are found in the main state machine - I played around a bit and it seems that something has worked out for me, which means that it will work for others as well)
2) I wonder what you are thinking of doing with the mixing trees, since several animations are used there and you can't add behavior to them, unfortunately...

But I'll say it again - very, very cool video - thank you!

romrom_
welcome to shbcf.ru