I really appreciate how you didn't just show the final solution but the entire iteration process. I think the information sinks in better that way.
@KetraGames2 жыл бұрын
Great to hear this, thanks 😊
@dangravel24512 жыл бұрын
Thanks a lot for this! Everywhere I read about blending animations told me "you need to setup your blend tree, and write a script"... Gee, thanks.. We all have things we're good at, and others not so much, this aspect I hadn't a clue how to set up. Liked, subscribed.
@lorddawn3752 Жыл бұрын
Damn that's impressive with each step explained. This should be a go-to tutorial for anyone using mecanim.
@KetraGames Жыл бұрын
Thank you 😊
@hefferwolff35782 жыл бұрын
This was so good, thanks so much!
@KetraGames2 жыл бұрын
Thanks, glad it was useful 😊
@wangyangshi10 күн бұрын
your videos are very clear to new learners, very great videos!
@KetraGames9 күн бұрын
Thanks, we appreciate this comment 😊
@rachapongwatana3868 Жыл бұрын
Thank you so much for sharing how to play with NPC Behavior with some random animation, Awesome tutorial !
Жыл бұрын
Just best animation tree tutorial on YT, I wish Narasimha bless your life and protect your family!
@KetraGames Жыл бұрын
Thanks for this comment
@evil_beast_z Жыл бұрын
ur Hi guys gives me a relief
@JermsKylefilms7 ай бұрын
love this video so much, not ashamed to say ive forget like 3 times and had to come back but thanks for this lol.
@MickyMiniAdventures Жыл бұрын
Thank you for your awesome tutorials. Your tutorials are very clean and easily understandable it's saves a lot of time. You are an inspiration to the female developers
@donpapamendez23522 жыл бұрын
Thanks for the tutorial, you are too good. you have a new subscriber
@KetraGames2 жыл бұрын
Thanks for your support 😊
@amcmahon1342 жыл бұрын
Hi, this tutorial series has been super well done and helpful! Are you planning to cover water/swimming at some point in the future?
@KetraGames2 жыл бұрын
Thanks. Yes, water, swimming and diving are on our list for future videos.
@mikehallvideos2 ай бұрын
This really really helped me out. Thank you!!!!!
@KetraGames2 ай бұрын
Great to hear, thanks 😊
@Tenzordk2 жыл бұрын
And my enemy's idle is done! - Thanks! :D
@KetraGames2 жыл бұрын
Great 👍😊
@evanlegrand8742 жыл бұрын
Such an awesome tutorial, thanks!
@KetraGames Жыл бұрын
Thanks very much for this comment 😊
@ani-gamer3202 жыл бұрын
Thanks again ❤️❤️❤️
@KetraGames2 жыл бұрын
👍😊
@IslamAudioStation Жыл бұрын
not the easiet method but it works. well done.
@KetraGames Жыл бұрын
In hindsight, this maybe wasn't the easiest approach. Perhaps a Direct Blend tree would have worked better. One to revisit in future 😊
@ObiWineKenobi9 ай бұрын
Thank you! This worked great!
@KetraGames8 ай бұрын
Great to hear, thanks 😊
@MVAgustaBrutale1000RR11 ай бұрын
You are the best override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { int randomClip = Random.Range(1,4); animator.SetFloat("Rise",randomClip); }
@combobreaker9618 Жыл бұрын
It works for me, but the counter on the float parameter "Bored Animation" keeps going down till values like -1.662e-44, and I can't get it to round 0. Any idea on what's causing that?
@KalponicGamesАй бұрын
You can create a preset to apply the settings faster. I think you already know it.
@seyfo.03 Жыл бұрын
It works very well, just the last animation will play on loop for a couple times. I don't understand why, any ideas?
@nikobellic74552 жыл бұрын
Why not use a sub-state machine? I have used animation sub-state for things like that and it was super easy to implement. Unless I am unaware of the benefits of using blend tree for this use case.
@KetraGames2 жыл бұрын
Hi, we originally thought that a sub-state machine would be the way to go with this as well. When we started to explore this though, there doesn't seem to be a way to transition from any state in the sub-state back to a state in the base layer. So you have to add a transition from every idle animation in the sub state to Jump in the base layer and to Move in the base layer. If you were to add other states from Idle such as Crouch, Pull Lever, etc. then you would have to duplicate these transitions as well. By using a Blend Tree we only have one state for Idle so we only have to set up and maintain one set of transitions. If you've found an easier way to do this using a sub-state machine then it would be really great to hear how you did it 😊
@nikobellic74552 жыл бұрын
@@KetraGames I see your point now. My project was fairly small, so I didn't have many transitions from idle. Thanks for your tutorial, learned something new.
@K3NZ Жыл бұрын
The stateInfo Normalized time is going up more than 1, what to do to fix the problem ?
@pushingpandas64792 жыл бұрын
this character is sooo cute
@KetraGames2 жыл бұрын
😄😄
@ivyxu5222 Жыл бұрын
Hi, thank you so much for making this video! I'm using this approach on a 2D animation. There are two idle animations, and there isn't the need for blending. However, when I set the waitTime to 5 or 6 seconds, the trigggered idle animations never play from the start or play till the end -- there are always some frames cut off. I have a feeling it has to do with the normalizedTime comparison, but I don't know how to fix this. Any hints or leads on this?
@krawper Жыл бұрын
Same problem as you, for a 2D character. I've been trying to find a solution since yesterday to fix this error, but it's difficult.
@ivyxu5222 Жыл бұрын
@@krawper my work around was to set the waitTime to 6s, which for me had the minimal cut off, and then extended the beginning of one idle animation with extra blank frames so the important part doesn’t get removed
@jussirautiainen7772 Жыл бұрын
This set up does not work ... if I use my own animations then the stateInfo.normalizedTime starts counting at 0.75 and never at 0 ... so the transitions play for a split second and return to the 0 state ...
@ColtPtrHun2 жыл бұрын
In my understanding, blendtree is for mixing animation clips, not select one of them. I think a Sub-State Machine (or a new animation layer maybe) would be a better fit.
@KetraGames2 жыл бұрын
Hi, you're absolutely correct in that this isn't the intended use case for a blend tree. We tried using a sub state machine first but you can't transition from any state in the sub state machine, so you end up having to add transitions from every bored animation and it becomes difficult to manage. Layers might be a better way to go though. We'll have a play and possibly redo this video if we find a better way 😊
@ColtPtrHun Жыл бұрын
@@KetraGames I see, you're right.. Since then I ran into the same problem with subtrees. I was thinking about using an empty state which would gather the transitions, and go to idle states from there, but that may would mess up the transitions.
@ColtPtrHun Жыл бұрын
@@KetraGames Also, moving these animations to a new layer feels a bit awkward, since these animations belongs to the same layer and what if I want to use custom transitions to-and-from the blendtree etc... It seems like blendtree is the way to go! Thank you for your answer 🙂
@KetraGames Жыл бұрын
@@ColtPtrHun Hi, we've thought of some other options since that may be easier that you may want to try. A direct blend tree might be able to get past some of the complication brought about by using the 1D blend tree. Another option, which is probably the easiest depending on how your scripts are set up, would be to switch animation states in the scripts rather than using the transition states in the animator, using docs.unity3d.com/ScriptReference/Animator.CrossFadeInFixedTime.html
@DenysAlmaral Жыл бұрын
@@KetraGames CrossFade is the way
@zachwang6156 Жыл бұрын
Love the tutorial! I followed the steps exactly but when I finished with the coding aspect and went into Unity to change the "Time Until Bored" I don't have the option to and instead there's an error message reading "Please fix compile errors before creating new state machine behaviours". What does that mean and how can I move forward?
@KetraGames Жыл бұрын
Hi, are there any errors in the console window?
@you_what319 Жыл бұрын
Curious, I've taken the +1 out of the Random.Range, changed numberOfBoredAnimations to numberOfIdleAnimations and set that to 4 in the inspector, this way makes more sense to me and has the same results. Is their anything wrong with this method that I don't see? Thanks again for another brilliant tutorial.
@KetraGames Жыл бұрын
Hi, that should work just fine. Whichever way makes the most sense to you 😊
@you_what319 Жыл бұрын
Thankyou Ketra, so far so good, I've not long finished this series and have gained a wealth of knowledge and have a solid starting point for my new Project. Much appreciated. Your style is so much easier to follow along.
@hmbullen2 жыл бұрын
Thanks for the tutorial! Could you use a 2D freeform blend tree rather than the 1D? Avoid having the multiple idle states in the blend tree to revert back too...
@KetraGames2 жыл бұрын
Hi, thanks for the suggestion. A 2d blend tree may work better or perhaps a direct blend tree 🤔. We'll have a play and may do a version two of this video if we find anything better
@forcepower71162 жыл бұрын
Hey, so sometimes when stopping to move it plays one of the bored animations. Is that supposed to be ? Because I thought it would only play them after we are idle for long enough
@KetraGames2 жыл бұрын
Hi, it shouldn't go straight into a bored animation. We ran into this problem when we were doing some testing for this video, and the problem was the order of the animations in the Blend Tree. Check that you have them in the following order. Breathing Idle, Bored, Breathing Idle, Shuffling, Breathing Idle, Offensive Idle. Hope that helps 😊
@marhirari Жыл бұрын
i'm already using a blend tree for idle, walk and run animation, how do i connect this one to the old one?
@KetraGames Жыл бұрын
Hi, you would connect the two blend trees with a Transition that goes from the idle blend tree to the movement one when there is movement input and then another transition that goes back again when there is no input. Hope that helps 😊
@yaxees3492 жыл бұрын
hi, when enemy tutorial?
@KetraGames2 жыл бұрын
Hi, we're hoping to start looking at enemy AI soon 😊
@penitentgamesАй бұрын
Why not use a substate machine for this? Then you don't need to mess with interlacing the default idle animation between the others and can control/finetune the transition between idle animations.
@KetraGamesАй бұрын
Hi, that does seem like the most obvious solution, and the route we first tried with this. Unfortunately we couldn't find a way of exiting the idle substate machine when conditions were triggered regardless of the internal state. For example when the jump is triggered you would want to be able to exit the idle substate machine and go to the jump state. The only way we found to make this work was to add transitions from all the states in the substate machine to the jump state in the base state machine, meaning you still have to duplicate all the transitions. If there's a way to make this work then we'd love to know because it would make this a lot easier 😊
@onursevinc68402 жыл бұрын
🔥🔥🔥
@KetraGames Жыл бұрын
👍😊
@zendraw34682 жыл бұрын
why dont you make a discord server
@khnuxsora Жыл бұрын
Hey, can I use this in a 2D game?
@KetraGames Жыл бұрын
Hi, you should be able to use the same principle in a 2D game 😊
@khnuxsora Жыл бұрын
@@KetraGames Thank you for the reply! 😄
@deathstroke28772 жыл бұрын
I need help xD. My player has autismus now.
@KetraGames2 жыл бұрын
Hi, what's going wrong? The full script is available here so you can compare with what you have - dotnetfiddle.net/ANF7BZ. I'd also check that the animations are in the correct order in the blend tree and have the correct thresholds. Hope that helps 😊
@deathstroke28772 жыл бұрын
@@KetraGames My idle animation playtime is too short, i guess.
@bunzy52792 жыл бұрын
Could you also do on player input, end bored?
@KetraGames2 жыл бұрын
Hi, if you start moving the animation will switch to running. Do you mean for other input?
@bunzy52792 жыл бұрын
@@KetraGames I was thinking along the lines of idle timer into an idle animation (say a sleep) then it wont change the new idle animation until we receive player input. If you've played hollow knight its like how the bench idle animation plays if that makes any sense.
@KetraGames2 жыл бұрын
@@bunzy5279 Ah, I see what you mean. Yes you could do a similar thing but just don't revert back to the original idle animation
@bobdawkins74738 ай бұрын
Wouldn't recommend this method in real (Depending on what your game is) because you'd want to use layering. This method is hard 1 to 1 and can't be called from other states in this setup.
@PranjayMittal2 жыл бұрын
Thanks. Im using unreal but I couldn't figure out how to actually do it