Unity Basics - Animation Events

  Рет қаралды 36,123

MetalStorm Games

MetalStorm Games

Күн бұрын

Пікірлер: 71
@MetalStormGames
@MetalStormGames 3 жыл бұрын
Thanks for watching, I wish I knew about Animation Events a lot earlier than I did so I hope this video helps out some beginners if they have never heard about them before.
@SMT-ks8yp
@SMT-ks8yp 2 жыл бұрын
Thanks! Somehow did not notice this option in the animation window at all.Gonna use it to play step sounds, much better that creating a separate audio source with loop and enabling/disabling it on state enter/exit by animation script.
@MetalStormGames
@MetalStormGames 2 жыл бұрын
And you could match it up exactly with the right frame when the animation of the foot hits the ground this way.
@eleanor...8282
@eleanor...8282 2 жыл бұрын
Thankyou so much!! I had an error and couldn't figure it out for a whole day, until watching this 😅
@MetalStormGames
@MetalStormGames 2 жыл бұрын
Glad it helped and thanks for watching
@camelmon
@camelmon 3 жыл бұрын
OHHH MY GOD! I watched a huge amount of tutorials but always missed the part where you should select object, until you just said it in video! THANK YOU VERY MUCH!
@MetalStormGames
@MetalStormGames 3 жыл бұрын
I did the same thing when I was trying to learn to use them as well, wondering why I couldnt see the public methods when selected the Event. Glad it helped.
@MrMurp35
@MrMurp35 3 жыл бұрын
Thanks very much. I've been trying to figure out this all afternoon and evening. Non convoluted and precise. Thanks for stopping me on working through to the early morning.
@MetalStormGames
@MetalStormGames 3 жыл бұрын
Great to hear that it helps. Thanks
@habitdaemon
@habitdaemon 2 жыл бұрын
That was excellent. Imported animations being unable to have an event added seems designed to trip us up. Duplicating the animation and reassigning was the perfect fix. Also explaining how to assign functions with the drop down only showing after the players is clicked on, again something only learned through experience. Thanks for this thoughtful tutorial.
@MetalStormGames
@MetalStormGames 2 жыл бұрын
Thanks, yeah that part about not seeing the drop down if the object is not selected really confused me when I first learned about them. That part was not mentioned so I want to make sure it was very clear. Glad it helped.
@ichabodcrane6198
@ichabodcrane6198 3 жыл бұрын
Awesome dude, very straightforward illustration of a feature. It helped me out. Thank you.
@MetalStormGames
@MetalStormGames 3 жыл бұрын
Thanks for watching and glad it helped. They can be very useful.
@lorandkelemen8253
@lorandkelemen8253 2 жыл бұрын
Short and clear explanation! Thanks!!
@MetalStormGames
@MetalStormGames 2 жыл бұрын
Glad it was helpful! Thanks for watching
@filipedecamargo3390
@filipedecamargo3390 2 жыл бұрын
I'm so stupid, I forgot to click at the player object. 4:40 Great vid
@MetalStormGames
@MetalStormGames 2 жыл бұрын
I still do that on a regular basis and always forget, even when you know to check that its so easy to forget.
@sunnymoon8161
@sunnymoon8161 Жыл бұрын
You just saved me a lot of trouble, thanks.
@johngrey5806
@johngrey5806 Жыл бұрын
Liked and subscribed. Explained like a pro!
@MetalStormGames
@MetalStormGames Жыл бұрын
Much appreciated!Thank you for watching
@rambii.
@rambii. 2 жыл бұрын
If I remember correctly, even if the animation is read-only you can still add an animation event. I’ve done this by clicking on the model that has the animation then in the inspector, I just scroll down to where “Event” is. From there, I can add what animation I want without duplicating the animation. I did it with an FBX file though
@MetalStormGames
@MetalStormGames 2 жыл бұрын
Interesting, I will try that next time to see. I find anything to do with models and animations in Unity there are several different ways to accomplish the same thing. I never noticed that spot though but it makes sense. Thanks.
@rambii.
@rambii. 2 жыл бұрын
@@MetalStormGames you’re welcome. Just one thing I forgot to mention is that it is on the FBX model with the animation that is in the project folder. Not a prefab nor an object in the scene.
@SpivSpirit
@SpivSpirit Жыл бұрын
This was very helpful. Thanks!
@MetalStormGames
@MetalStormGames Жыл бұрын
Great to hear, thanks for watching
@wololoaeoo4120
@wololoaeoo4120 Жыл бұрын
magnificent tutorial! thank you!
@MetalStormGames
@MetalStormGames Жыл бұрын
Thank you very much and thanks for watching
@Chadwikj
@Chadwikj Жыл бұрын
Very clear thanks
@MetalStormGames
@MetalStormGames Жыл бұрын
Thank you for watching
@Entikai
@Entikai 2 жыл бұрын
Thank you so much for the video!
@MetalStormGames
@MetalStormGames 2 жыл бұрын
Thank you for watching, glad it helped out.
@stellar7933
@stellar7933 Жыл бұрын
Amazing guide, I'm gonna use this for my next project. Question though, why do you need to make a public method to access the AttackSequence() method when it looked like you could access it straight from the animation event even though it's private?
@MetalStormGames
@MetalStormGames Жыл бұрын
You know I am not actually sure if it needs to be private or not, if it works as private then yeah I would definitely go that route. I cant confirm as dont have Unity available right now but yeah I would just test it out and if private works then that is a much better option.
@stellar7933
@stellar7933 Жыл бұрын
@@MetalStormGames 👍👍
@ao8462
@ao8462 2 жыл бұрын
good bro very good thank you sir thank you very much
@MetalStormGames
@MetalStormGames 2 жыл бұрын
Thank you for watching
@XR-JAM
@XR-JAM 9 ай бұрын
thanks dude :D
@michaelp8376
@michaelp8376 Жыл бұрын
Thank you!!
@MetalStormGames
@MetalStormGames Жыл бұрын
You're welcome!
@Ptah1130
@Ptah1130 3 жыл бұрын
Thanks for this. Much appreciated. Hey. Can you do a tutorial on instantiating a different prefab everytime heath meter decreases/ increases every 25%? Can you also do one on playing a different animation each time health meter decreases/increases every 25% as well?
@MetalStormGames
@MetalStormGames 3 жыл бұрын
Thanks for watching, I can add that to the list but all you really need to do for the instantiating one is just use Random.range for the index of an array of game objects that you want to instantiate and it will pick a random one each time. For the random animation one you could call the Animator.Play method and pass in a string of the animation name that you want to play.
@SeleDreams
@SeleDreams 3 жыл бұрын
the problem is that i am instancing dynamically characters so i can't just link an object reference like this
@MetalStormGames
@MetalStormGames 3 жыл бұрын
Not sure exactly what you mean or what you are doing but perphaps animation events are not what you are looking for then?
@locusruizlopez5997
@locusruizlopez5997 2 жыл бұрын
thanks
@MetalStormGames
@MetalStormGames 2 жыл бұрын
You're welcome!
@adslpiulentoditalia2545
@adslpiulentoditalia2545 2 жыл бұрын
That what i love to see . But i have the question regarding to this. Events animation Is the same method of function? I mean you can just declare events as a string without necesarly add a function
@MetalStormGames
@MetalStormGames 2 жыл бұрын
I am not sure if I am understanding you correctly but yes you can put in an event that does not actually exist and that will usually give an warning in the console when you run the game and it plays that animation saying that the method could not be found or something similar to that.
@adslpiulentoditalia2545
@adslpiulentoditalia2545 2 жыл бұрын
@@MetalStormGames i remember that you can declare events directly from animation for example i'm gonna write step events and declare It directly inside the script. For example in your case It was public void AttackAnimator() But what i mean is public void Attack animator as events inside animation
@MetalStormGames
@MetalStormGames 2 жыл бұрын
I think I know what you mean but not sure, if so then yes you can also add events inside the animator as well as animator states that can control them. Let me know if it all works out for you! good luck.
@adslpiulentoditalia2545
@adslpiulentoditalia2545 2 жыл бұрын
@@MetalStormGames yes absoloutely work great both of them. I think it's used to not duplicate animation even If they're read only. Btw very good video thank you.
@杨悍文
@杨悍文 3 жыл бұрын
Can you upload the full project?it's hard to understand without debug it local.
@MetalStormGames
@MetalStormGames 3 жыл бұрын
The license from all of the assets does not allow me to but I can look in to that in the future if people prefer it with basic primitive assets instead so I can do that. Sorry.
@杨悍文
@杨悍文 3 жыл бұрын
@@MetalStormGames thanks for your answer and video.I'll try my best to understand it
@MetalStormGames
@MetalStormGames 3 жыл бұрын
If you have questions feel free to ask or even hop on my discord if you want the link is in the video description and i can try answering questions when I am around. Once you do one or two animation events though it usually starts to make sense and you will probably use them quite often as they are very handy.
@Stinger-rq4gy
@Stinger-rq4gy 3 жыл бұрын
Hi metalstorm games, do you take tutorial requests? I need help.🤕
@MetalStormGames
@MetalStormGames 3 жыл бұрын
I am not sure if I would be able to do everything but let me know what it is and it is definitely possible.
@Stinger-rq4gy
@Stinger-rq4gy 3 жыл бұрын
@@MetalStormGames Dear Metal Storm, In my scene I got my FPS Character Controller (the player) and my Zombie following the FPS Character Controller with script, and I added a attack trigger so when the FPS Character Controller gets close the zombie attacks the FPS Character Controller at 4.0 Stopping Distance. So all I need to do is the health bar goes down when the zombie attacks the FPS Character Controller, does anyone know any tutorials that show the C# Visual Studio code or in Bolt Visual Scripting to make the health bar go down when the zombie attacks the FPS Character Controller? Or can anyone walk me through it on Unity 3D? I cannot find any KZbin tutorials on a health bar going down when a enemy attacks the FPS Character Controller, in the tutorial they just talk about the health bar going down when the space bar is pressed, or the health bar changing color's as it goes down. Can you make this KZbin tutorial for me, I am sure it will help lots of other people with making their video games? Also can you make a Bolt Visual Scripting KZbin Tutorial with like a split screen of what is going on in the Graph Inspector with the nodes connected, and what it is making an object do in the scene simultaneously? So you would simultaneously show 2 screens one with the Graph Inspector, and another screen showing the behavior of the object in the scene really quickly in like a fast montage of split screen clips, so people can learn Bolt Visual Scripting fast, and find what they are trying to code quickly. I think this would make a great KZbin tutorial and teach people so quickly, can you make a KZbin tutorial like this? this should get you more views, more subscribers, and more money.
@MetalStormGames
@MetalStormGames 3 жыл бұрын
I have never used Bolt so I cant help there at all, for the health thing though just make a health variable on your player that gets a damage value subtracted when you collide with the zombie, then when that is working make a health bar and link the 2. Brackeys has a very beginner friendly health bar tutorial video that shows how to set it up and link. There are tons of basic health bar videos for Unity but I would recommend either the one on Brackeys channel or the one on CodeMonkeys channel. Hope it helps.
@MetalStormGames
@MetalStormGames 3 жыл бұрын
Down the road I want to make a health bar video but it wont be for quite a while, I am also trying to work on making a complete beginner course as well but that is going to take quite a bit of time yet before it is ready.
@Stinger-rq4gy
@Stinger-rq4gy 3 жыл бұрын
@@MetalStormGames thank you metal storm, I am having a real hard time finding a video on this health bar goes down when enemy attacks the FPS Character Controller script. I am learning coding day by day, but even the best programmers do not know all scripts, and nodes in Bolt.
@fv4202x
@fv4202x Жыл бұрын
This is helpful but you could explain this in 10 seconds.
@MetalStormGames
@MetalStormGames Жыл бұрын
There are many other videos that do, I wanted to go through it a bit more for the people that need a slower explanation with real example.
Escaping Unity Animator HELL
18:18
Lost Relic Games
Рет қаралды 515 М.
Raycasts in Unity (made easy)
16:30
Game Dev Beginner
Рет қаралды 99 М.
HELP!!!
00:46
Natan por Aí
Рет қаралды 66 МЛН
КОГДА К БАТЕ ПРИШЕЛ ДРУГ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 8 МЛН
Random Emoji Beatbox Challenge #beatbox #tiktok
00:47
BeatboxJCOP
Рет қаралды 66 МЛН
Car Bubble vs Lamborghini
00:33
Stokes Twins
Рет қаралды 43 МЛН
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,6 МЛН
How I learned Unity without following tutorials (Developing 1)
18:11
Game Maker's Toolkit
Рет қаралды 2 МЛН
Intro to Animation Rigging & Procedural Animation in Unity
13:33
iHeartGameDev
Рет қаралды 195 М.
Animator Transition Interrupt Sources, Explained | Unity Tutorial
10:01
How to use Unity Animation Curves (NOT JUST ANIMATION!)
21:50
Code Monkey
Рет қаралды 63 М.
I Decided to Speedrun a 9,600 Hour Long Game.
16:43
GeoSage
Рет қаралды 1,3 МЛН
Don't use the Unity Animator, Use Code Instead! - Tutorial
19:16
Small Hedge Games
Рет қаралды 20 М.
How I Would Start Game Development (If I Started Over)
16:59
Thomas Brush
Рет қаралды 133 М.
Unity's New Input System:  The Definitive Guide
32:07
DmanGames
Рет қаралды 32 М.
HELP!!!
00:46
Natan por Aí
Рет қаралды 66 МЛН