Unity Basics - Animation Events

Sdílet
Vložit
  • čas přidán 25. 08. 2024

Komentáře • 71

  • @MetalStormGames
    @MetalStormGames  Před 3 lety +13

    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 Před 2 lety +6

    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  Před 2 lety +1

      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 Před 2 lety +2

    Thankyou so much!! I had an error and couldn't figure it out for a whole day, until watching this 😅

  • @camelmon
    @camelmon Před 3 lety +1

    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  Před 3 lety

      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 Před 3 lety +2

    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.

  • @habitdaemon
    @habitdaemon Před 2 lety +1

    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  Před 2 lety +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 Před 3 lety +2

    Awesome dude, very straightforward illustration of a feature. It helped me out. Thank you.

    • @MetalStormGames
      @MetalStormGames  Před 3 lety

      Thanks for watching and glad it helped. They can be very useful.

  • @lorandkelemen8253
    @lorandkelemen8253 Před 2 lety +1

    Short and clear explanation! Thanks!!

  • @filipedecamargo3390
    @filipedecamargo3390 Před 2 lety +2

    I'm so stupid, I forgot to click at the player object. 4:40
    Great vid

    • @MetalStormGames
      @MetalStormGames  Před 2 lety

      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 Před rokem

      You just saved me a lot of trouble, thanks.

  • @Chadwikj
    @Chadwikj Před rokem +1

    Very clear thanks

  • @SpivSpirit
    @SpivSpirit Před rokem +1

    This was very helpful. Thanks!

  • @johngrey5806
    @johngrey5806 Před rokem +1

    Liked and subscribed. Explained like a pro!

  • @wololoaeoo4120
    @wololoaeoo4120 Před rokem +1

    magnificent tutorial!
    thank you!

  • @ao8462
    @ao8462 Před 2 lety +2

    good bro
    very good
    thank you sir
    thank you very much

  • @Entikai
    @Entikai Před 2 lety +1

    Thank you so much for the video!

  • @XR-JAM
    @XR-JAM Před 6 měsíci

    thanks dude :D

  • @michaelp8376
    @michaelp8376 Před rokem

    Thank you!!

  • @rambii.
    @rambii. Před rokem

    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  Před rokem +1

      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. Před rokem

      @@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.

  • @stellar7933
    @stellar7933 Před rokem +1

    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  Před rokem +1

      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 Před rokem

      @@MetalStormGames 👍👍

  • @locusruizlopez5997
    @locusruizlopez5997 Před 2 lety +1

    thanks

  • @SeleDreams
    @SeleDreams Před 2 lety

    the problem is that i am instancing dynamically characters so i can't just link an object reference like this

    • @MetalStormGames
      @MetalStormGames  Před 2 lety

      Not sure exactly what you mean or what you are doing but perphaps animation events are not what you are looking for then?

  • @Ptah1130
    @Ptah1130 Před 2 lety

    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  Před 2 lety +1

      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.

  • @adslpiulentoditalia2545

    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  Před 2 lety

      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 Před 2 lety

      @@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  Před 2 lety

      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 Před 2 lety +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.

  • @user-ub9iq3jo4k
    @user-ub9iq3jo4k Před 3 lety

    Can you upload the full project?it's hard to understand without debug it local.

    • @MetalStormGames
      @MetalStormGames  Před 3 lety +1

      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.

    • @user-ub9iq3jo4k
      @user-ub9iq3jo4k Před 3 lety +1

      @@MetalStormGames thanks for your answer and video.I'll try my best to understand it

    • @MetalStormGames
      @MetalStormGames  Před 3 lety

      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 Před 3 lety

    Hi metalstorm games,
    do you take tutorial requests?
    I need help.🤕

    • @MetalStormGames
      @MetalStormGames  Před 3 lety +1

      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 Před 3 lety

      @@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 CZcams 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 CZcams 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 CZcams 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 CZcams tutorial and teach people so quickly, can you make a CZcams tutorial like this?
      this should get you more views, more subscribers, and more money.

    • @MetalStormGames
      @MetalStormGames  Před 3 lety +1

      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  Před 3 lety +1

      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 Před 3 lety

      @@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 Před rokem

    This is helpful but you could explain this in 10 seconds.

    • @MetalStormGames
      @MetalStormGames  Před rokem +1

      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.