Damn. You can make an entire game inside of the animator. That's crazy.
@reubenlouwerse4251
6 жыл бұрын
It feels like whenever I need to know how to do something for my game, you just happen to cover it! Great video!
@wignermatos1470
6 жыл бұрын
Yes, Noa is Amazing
@wVAjaxVw
6 жыл бұрын
How did I not know about behaviors in the animator?
@AOG91
4 жыл бұрын
Same, I’m mind blown!
@monkeyrobotsinc.9875
3 жыл бұрын
@@AOG91 DITTO
@MeowMeow-ev8tv
3 жыл бұрын
same here!
@DawnosaurDev
6 жыл бұрын
Yes Yes Yes So much easier than using the official unity video (Finite state machines probably outdated) Most useful video yet!!!
@brandonfleming7118
5 жыл бұрын
everything on the unity site is outdated some as old as version 2
@tejaschalke1778
6 жыл бұрын
I expected part 2 of ranged attack tutorial first, but this is a great Video. Loved it !!!
@Blackthornprod
6 жыл бұрын
Thanks :) ! I'm really happy you liked this video, and of course ranged combat Part 2 will come out soon enough :) !
@javiermahana3475
5 жыл бұрын
WOOOOW... I tried myself to make a state machine countless times and in the animator is one just waiting for us!!! Noa you are great and you save me a lot of time :DDDDD
@MuhammadAdnan-lq6gc
6 жыл бұрын
Awesome and unique tutorial. This tutorial really opened my eyes about the possibilities Unity is offering to develop quality games. Great thanks for these kind of tutorials.
@shanestevens516
6 жыл бұрын
This video was so helpful but not in the way you might think. I know how to make advanced AI using a finite state machine, But I've completely overlooked the StateMachineBehavior with the Animator to play particle effects or other behaviors when entering and existing animations! THank you!
@mirela9974
6 жыл бұрын
Awesome tutorial as always!
@michaeloconnell145
5 жыл бұрын
You have blown my mind, the animator behaviors are brilliant!
@ludicrouS_406
4 жыл бұрын
Blackthornprod: some vicious warcry No one: Enemy: yAAAA
@Vengard1000
6 жыл бұрын
WHY CAN'T I THUMBS UP MORE THAN ONCE!!! Haha, great video. Very informative, simple, and useful information.
@bunggo9914
6 жыл бұрын
so we can add scripts to an animation! wow....
@MrPoporucha
5 жыл бұрын
Most enemies in the game Rainworld uses animator behaviours for AI
@danbobjim123
5 жыл бұрын
@@MrPoporucha cool!
@magnusm4
4 жыл бұрын
What's also awesome is you can add scripts to the animation itself. You open the animation window, drag in the animation and then you can add a script anywhere in the time of the animation. So you can start a gun particle or hammer swing at any point in the animation. Like if your enemy has a delayed jump, then instead of coding in a delayed particle, you instead just make the animation call the function in the script at the point he jumps. Easy peasy lemon squeezy
@monkeyrobotsinc.9875
3 жыл бұрын
@@magnusm4 nioce
@TrueValience
6 жыл бұрын
once again another awesome tutorial from my fav unity channel
@MSarhan
6 жыл бұрын
Great tutorial but please if you can do a tutorial on tilemaps because I'm sure that it will be great to learn that from you
@buraqalaeli6619
2 жыл бұрын
Amazing and simple tutorial, this will boost my production really well!!
@dr.mailman
4 жыл бұрын
Wow I never knew how to utilize the behavior scripts. This is drastically going to change the way I make CCs and AI
@eddgrs9193
5 жыл бұрын
best State Machine explanation video ever.
@xekser-132
6 жыл бұрын
Finally, waiting so long!
@1ht1baron
6 жыл бұрын
Could you make a tutoriel about smart enemy ai (can jump, climb,...) on side scroller 2D?
@Zakiev_Omar
5 жыл бұрын
1ht1baron that would be different you need to be on the intermediate tutorials mate
@monkeyrobotsinc.9875
3 жыл бұрын
@@Zakiev_Omar LOL
@SSMLivingPictures
4 жыл бұрын
With full sincerity, thank you so much for this video and doing what you do. This answered so many riddles I had about hurdles with my own game and propelled my knowlegde / progress forward so much I cant even tell you. I swear I was just waiting to find this video. Cant thank you enough.
@luciacover9909
6 жыл бұрын
Hey Noa! Great video and your Ludum Dare game looked so fun! I hope you were able to get your game on the leaderboard! Is this what our boss battle tutorial is? If so it’s made very well! Have a good morning, day, and evening!
@Blackthornprod
6 жыл бұрын
Thanks Ben :) ! No this wasn't really my boss tutorial, that will come out some time soon ;) !! And I'm really glad you liked my LD game ! The feedback I received was awesome, helpful and so motivating (3rd most rated game of LD so far :D) !
@luciacover9909
6 жыл бұрын
Blackthornprod well I hope it stays in that place or goes up
@silencer3kmg
4 жыл бұрын
Of all the people out there making tutorials for UNITY your videos are definitely the only ones that say "go watch another video to learn this part". Most people show how to do something from start to finish. Not show the middle and then recommend in their video to go watch two other videos. click bait is click bait
@Norbingel
4 жыл бұрын
Alright, where's the promised part 2? :D
@TheUnscriptedMind
4 жыл бұрын
unable to use the search function???? kzitem.info/news/bejne/w49qrqZosWJmo20
@Norbingel
4 жыл бұрын
@@TheUnscriptedMind thanks but that link is to a 2D ranged combat system
@TheUnscriptedMind
4 жыл бұрын
@@Norbingel and he said what? Part 2 "Ranged Combat Tutorial" .... 7:45
@Norbingel
4 жыл бұрын
@@TheUnscriptedMind I was actually referring to 7:30 where he said "it is very likely that I made a part 2 State Machine Behavior Tutorial in the near future" right before he says the part about making a Ranged Combat Tutorial.
@TheUnscriptedMind
4 жыл бұрын
@@Norbingel kzitem.info/news/bejne/xI6bzIyJfWSEgGU maybe this? that video was 1 week later and has state machine behaviours...
@TheRealMobiius
4 жыл бұрын
Completely revolutionized the way I'll do AI from now on!! :)
@snipy27
6 жыл бұрын
Never used state machines before, but it looks really nice to use, gonna try it out for sure :)
@TheArtist808
4 жыл бұрын
Easily the best tutorial of this type on KZitem
@simoncodrington
6 жыл бұрын
Cheers for the videos mate :) You always have really top notch stuff.
@abidounesaad3780
6 жыл бұрын
Hey Noa thanks for the video, I absolutely love your content, can you please recommend some learning materials for Unity??
@Blackthornprod
6 жыл бұрын
Hey :) !! Best learning material available is on the actual Unity website (Space Shooter and Top down Shooter series) and on KZitem (on my channel, Brackeys and Sebastian Lague ;D) ! You can also check out the UDEMY website and search for Unity courses, there's a couple great tutorial series out there as well (payed though)!
@abidounesaad3780
6 жыл бұрын
Thanks for replying, keep up the great work!
@rashidfarhan6223
6 жыл бұрын
Sebastian Lague tutorials are really good if you're from a programming background, you'll find his videos interesting.
@Justeeee115
3 ай бұрын
Awesome this just give alot of ideas on how to make my ai with ease
@tyelork
6 жыл бұрын
Finite State Machines are also good for controlling the state of the game, i.e. MainMenu, Running, Paused, Game Over, etc. I also ended up writing my own generic FSM for my LD42 Compo entry, but only used it for the game state. If I make enemies it's generic enough to use for enemies behaviors. I've never used the animation system to control states though, that's a neat way of going about it.
@wignermatos6616
6 жыл бұрын
Thanks for the video !
@no_0nehere_875
3 жыл бұрын
Yup you opened my Eyes. Starting Unity now....
@AzaiKang
5 жыл бұрын
Damn, this is a more easy to understand than my current enemy AI script. Thanks!
@daveejons
6 жыл бұрын
Alright next tutorial has to cover ai moving around obstacles
@JaycubMacawl
5 жыл бұрын
@@ILPYou what about in 2D
@monkeyrobotsinc.9875
3 жыл бұрын
@@JaycubMacawl dont make 2D
@zachgeyer8090
4 жыл бұрын
Thanks for the tutorial! This is really useful for my current project!
@TheFritoNation
3 жыл бұрын
Great video! I remember watching this when I was new to game development and now that I'm more experienced I was wondering when you would want to use this rather than regular code?
@MV-dh6ve
4 жыл бұрын
Love your tutorials! Thanks
@dharmeshkumar2763
6 жыл бұрын
today i learnt a new thing. i have never seen this type of tutorial before......thankssss....... i want to confirm one thing that does 'animator.transform.position' indicates enemy position in this tutorial? now i am waiting for part-2 of this tutorial. great work.....
@Michael-The-Composer
6 жыл бұрын
Yes, animator.transform.position does indicate the enemy's position because we are setting it to move towards the player.
@user-bo5vr1ib6i
5 жыл бұрын
"animator" is a property in the StateMachineBehaviour class of which the script is deriving from, which has the type Animator and holds a reference to the Animator component on the GameObject, in which holds the property "transform" of type Transform, which holds the reference to the GameObject's Transform component, in which has the property "position" of type Vector3, which holds the position of the GameObject. And since the Animator he was making a behavior script for was sitting on the enemy, yes, it is referring to the enemy's position.
@dharmeshkumar2763
5 жыл бұрын
@@user-bo5vr1ib6i thanks
@Lizard_geek
5 жыл бұрын
I have made game in Blender Game Engine in the past and I gotta say im glad ive started learning unity.
@leetness13
5 жыл бұрын
next step is the Unreal Engine, 100 times more powerful than Unity :)
@tijon1350
3 жыл бұрын
@@leetness13what you're saying is bullshit, unity and unreal engine are both same powerful
@VBox_tuhin
3 жыл бұрын
awesome video dude .. ❣❤
@upstart_art6558
3 жыл бұрын
Dude, you deserve lot of subs after brakeys leave you are been my brakeys now
@valdytech2002
6 жыл бұрын
really great job !!
@DrRoncin
4 жыл бұрын
Thanks for the great tutorial! Loved the simplicity of this technique. Without animations, I encountered a 0.5s delay between exiting state A and entering state B. -> The "Has Exit Time" has to be turned off for fast transitions.
@fatemermg7490
4 жыл бұрын
it definitely opened my eyes!!
@_Garm_
6 жыл бұрын
cool use of the built in state machine :D
@darkbibni
6 жыл бұрын
We have used that same system to create some Boss AI in our student game ^^ A Better AI option is behaviour tree if you need very complexe AI !
@skyacaniadev2229
5 жыл бұрын
I'm using animation events all the time without knowing that I can attach script to animator states...
@deraminator945
2 жыл бұрын
This is how a state machine works???? This looks very understandable
@beelancah340
6 жыл бұрын
Cool tutorial
@solid-parker237
Ай бұрын
"Ahhhh, help! The enemy is FARTING towards me"
@bladefier1954
4 жыл бұрын
God... That was easy... Thank you so much Noa
@Steven_Something20
6 жыл бұрын
AI with pathfinding for 2D would be great as well. Something like A*, but with your breakdowns of the mechanics would be very helpful.
@Korn1holio
5 жыл бұрын
I second that
@FadilSyhptra
2 жыл бұрын
thank you bro
@thekingsfool8879
6 жыл бұрын
Another awesome video. Thank god for BTP :-)
@unityhelp6139
4 жыл бұрын
Very useful tutorial.
@richnaisanze
5 жыл бұрын
part 2 pleasee! nice vid keep it up !!
@durrium
3 жыл бұрын
Very cool! One question: is this state machine animator a separate animator from the enemys walking animator?
@AndrzejGieraltCreative
4 жыл бұрын
Awesome! Could you do a tutorial on how to integrate things like opening doors into AI pathfinding?
@tijon1350
3 жыл бұрын
make a sight collision box and if there is a door close in the sight collision box, open it. (the script is really simple, nothing special.)
@AndrzejGieraltCreative
3 жыл бұрын
@@tijon1350 hmmmm is it though? What if he's in a tight space and the collision box hits 2 doors? I've been having a lot of trouble with this tbh, I was using raycast earlier but haven't touched the idea in a while.
@crypticcoding9680
5 жыл бұрын
Thank You So Much!
@171694
Ай бұрын
Wow! THank you!
@ma08serrano
5 жыл бұрын
cool. this exactly what i am looking for. thx
@CybeargPlays
5 жыл бұрын
Are there any downsides to using the animator's state machine as the AI state machine? And on the flip side, are there any upsides to creating a parallel, code-based state machine for the AI and keep the animator state machine to visuals/animations only?
@CustardCream33
4 жыл бұрын
Really want the answer to this! Stumbled across this video because i'm lost but i'm not sure if it's good practice to use it without any animations..
@urzytkownikYT
5 жыл бұрын
Is that really a good approach to controll AI through anim states? shouldnt some ai manager itelf controll animator?
@caxopog
4 жыл бұрын
Yea, a very interesting question. Cause... it looks strange when AI is controlled by ANIMATOR, not vice versa
@diliupg
4 жыл бұрын
@@caxopog stranger things ... ;-)
@tonywoods1226
4 жыл бұрын
It's actually alright. It's good for visualization
@arcclite1144
4 жыл бұрын
@@tonywoods1226 I think the point is for any project of decent size, you probably want to isolate your "animation layer" from your "AI state machine layer" better than this. It's a good visual tool, but it's not how you probably "should" code it, separate from Unity's helpers. It depends a bit on how much of your game BL code you want to live "in" Unity, vs just being C#. EDIT: since this has a few updoots now, and as someone doing exactly this, I'd say (in general) aim to have your new state's "onBegin" callback trigger your animation changes. That's worked really well for me so far. "Player hit attack button -> change to attack state -> animate the attack", with various BL/validation goo.
@aldigangster123
4 жыл бұрын
wondering myself. There is a Unity talk with the Fire Watch developer talking on state machines / animator. And at the end he is warning on using the animator as a state machine, like shown here as well. He meant it can get easily very complex and hard to debug, if everything lives in the animator. IMO, It's definitely no issue with a simple project like shown here, but rarely any tutorial shows an implementation for an actual realistic project, with more than just two objects following each other. I'm tempted on using it, but I think down the road, I will be making my life easier when the Finite-State-Machine is controlling everything incl. the animator, and not the other way around. Jason Weismann is showing good beginner friendly implementation of FSM, if anyone is interested.
@sumanth664
5 жыл бұрын
Hey Noa, I've come across your channel recently and you've pretty great content. Can you make a video specifically for game audio as in how to select audio or the theme to the game and its implementation.
@Ksavputin
5 жыл бұрын
very nice tutorial
@asdf7053-n9w
5 жыл бұрын
Great video. Thanks a lot :)
@cinemacat4108
3 жыл бұрын
I know that my comment is late but if you want to check if the player is near the enemie you can Physics2D.OverLapCircle(enemie.position, raidus, "the layer of the player");
@misterprop9089
6 жыл бұрын
You are the best youtuber for the unity tutorial
@Blackthornprod
6 жыл бұрын
Thanks so much for the encouraging comment :) !!
@sleepingknight3832
6 жыл бұрын
Nice video!!, can you make a full RPG tutorial?
@eyeprops5422
5 жыл бұрын
Ranged combat part two ... wooo hooo... : )
@becalmcsgo4622
2 жыл бұрын
Tnx for tut!
@LittleGameDev
6 жыл бұрын
Hey Noa, i need a bit of help. do you know where I can find some tutorials for Unity on making a cooking tycoon? I been trying to find a cooking tutorial where the player has to cook, then leave there cooking station to sever customers. Kind of like Chocolate tycoon but instead of the serving the customers at the counter you serve them at a table. If you don't know any tutorials on this could you please post a video explaining how you would tackle the challenge.
@magnusm4
4 жыл бұрын
Been stuck on movement controls for years. But this state code has gotten me so excited I immediately got to Blender and started modeling to then rig and animate it to use this. Is it possible to have already declared variables? So for example you don't have to declare a movement variable to be equals to the player's velocity every time you start walking . Especially if you have multiple variables and stats affecting movement. I wonder if these state scripts can get other scripts's variables. For example I still have a movement script on the player which handles falling, input, physics, drag and such so that there's universal effects on the player regardless of animation state. Also accessing some variables of the player such as speed, strength force etc. Wouldn't want a Tomb Raider where jumping is hard coded so you can glitch and run in the air. Still have no idea why anyone ever thought that was a good idea.
@shinkouhai919
5 ай бұрын
You just saved me from a spaghetti code...
@gobblestheturkey1413
3 жыл бұрын
Thats gunna be an insta-subscribe from me dawg.
@clintonyong1541
6 жыл бұрын
Hi there blackthorn. Love you video very much! Can you do a tutorial on how to make a 2D character slide for dodging obstacles? Thank you so much :)
@dragon121978
2 ай бұрын
Great video, can you explain how to do the same thing but rather than hitting a button to change states, the npc changes states with either line of sight or within a range of the npc
@julianorocha2280
6 жыл бұрын
My eyes are now open. And my mind blowed up
@psycho7083
6 жыл бұрын
The "private PatrolSpots patrol;" is highlighted with red... what i need to do? I need to create a script called PatrolSpots? If i need to do this what needs to be writhed inside this script?pls help;)))
@namcon555
6 жыл бұрын
Late reply but you’re going to need another script called ‘PatrolSpots’. I’m sure this is all explained in his AI series, but it looks like the PatrolSpots class will probably generate an array of random coordinates Called patrolPoints. Basically you’re gonna need to watch his other series on AI.
@wyzebeatz3742
5 жыл бұрын
I was wondering about this too. I looked at the project files and PatrolSpots and the only thing inside of it is an array of transforms called patrol points. Not working for me. But here's the link to the script github.com/BlackthornProd/State-Machine-Behavior-Tutorial/blob/master/State%20Machine%20Project%20Files/Assets/Scripts/PatrolSpots.cs
@williamstrnad4243
6 жыл бұрын
Best unity youtuber!
@Blackthornprod
6 жыл бұрын
Thanks so much mate :) !
@keremkurban8156
5 жыл бұрын
I came searching for copper but found gold. #ThxBlackthornprod
@Gooseguy1000-1
2 жыл бұрын
This is interesting, but wouldn’t it just be easier to give them multiple scripts and use setActive when you want them active, and the opposite when you don’t want them active?
@ignacioveliz125
4 жыл бұрын
Ty
@tunvas
2 жыл бұрын
When do you use State Machine Behaviours and when do you create your own pure C# State?
@felipexg4032
5 жыл бұрын
All the spaggetti code to the trash. Must remake the AI again. I love you man.... I'm crying... kinda happy?
@elingranath
6 жыл бұрын
Vicious warcry: "...ʸᵃᵃᵃ"
@MAMFMAHMOUD
6 жыл бұрын
hi noa, can you make a tutorial about how you make (walking/running/idle/jump) animation ? cause i am having a hard time with it.
@dc5285
5 жыл бұрын
Il send you a link later if i forget remind me
@sirtroll4546
5 жыл бұрын
@@dc5285 i think he forgot to remind you
@Skyvastern
4 жыл бұрын
What the freak, didn't even know there was a thing like this that existed. And now when I think of it, yes there was this add behaviour button on animation states, and to my surprise I never bothered to care about what it actually does 😅
@AbdulWahab-ev2ct
6 жыл бұрын
amazing good work. ! Keep doi'n it. can u please do a video which covers the dimensions, optimization and quality of art in pixels (should sprites be in 1024x1024 , 512x512 etc or ) for better and maximum result in unity without having any performance issues Kind Regards abdul
@someoneelsecrystaloffical458
6 жыл бұрын
Do You Know How To Make A More Advanced AI So Like Level 3 AI
@kdawgfsho04
3 жыл бұрын
instead of key down to get him to start following from idle i just want him to start i dont want to press keys.. how would i do this?
@eren_guneri
2 жыл бұрын
With the MoveTowards the enemy can't collide with any colliders. Is there a way to prevent this?
@andressblabla
5 жыл бұрын
Hello Noah! I love your tutorials. I have a question: Where is the video where you explain that patrolling script? I found two videos about patrolling in 2D in your channel, but they are not using the same lines of code. They are slightly different than this video's version, so they don't work. The major difference is that here you are referencing a custom class named PatrolSpots, but I haven't found the video where you show how you created that class. Thanks again for the free content and I intend on becoming a patreon very soon. Cheers.
@catarina5375
4 жыл бұрын
Hey! Você é BR então fica mais facil de te explicar! O Noah basicamente criou um Script chamado "PatrolSpots" e dentro dele retirou tanto o start como update e colocou isto escrito: public Transform[] patrolPoints; Depois, ele criou um GameObject com o transform resetado (tudo em 0) e chamou ele de "PatrolSpots". a tag (PatrolSpots) vai ficar nesse GameObject ! Neste GameObject ele colocou também o script "PatrolSpots". Ai você vai criar alguns GameObjects como filhos desse primeiro, eles não precisam da tag! O pai ja tem então ta tudo certo. Me avisa se deu certo :D
@catarina5375
4 жыл бұрын
o script você faz o mesmo que no caso ele mostrou no video, apenas essa parte que te disse que você faz diferente
@PxlDev
5 жыл бұрын
The type or namespace PatrolSpots could not be found...
@arcenciel99
4 жыл бұрын
just wondering, what's the difference between if we add the same scripts to the enemy and to the animation?
@koks49045
5 жыл бұрын
Why you cant drag and drop gameobjects from your SCENE onto public GameObject in your scripts that were added to particular animation? Normally thats obvious that it works, in normal scripts it always works, but if scripts is added thorough this add behavior options, this just doesn't work...
@lorenzodezi2349
4 жыл бұрын
I was wondering: isn't it costly to initialize the fields of the behaviour every time OnStateEnter is called? Is there a better way to initialize things once, like patrolSpots?
@joll98
4 жыл бұрын
yeah especially with using findGameobjectwithTag, better to cache it. something simple I can think right now is put a bool check condition to make sure the patrolSpots is found only once
@mrpoulpe520
6 жыл бұрын
Oh thank you, is this video related tu my comment ?
@JesusMartinoza
4 жыл бұрын
Thaaanks!! My code is way more cleaner using behaviours! :D
Пікірлер: 209