No video

Creating your first animated AI Character! [AI #01]

  Рет қаралды 105,586

TheKiwiCoder

TheKiwiCoder

Күн бұрын

This is the first video of a brand new AI series! Animations are added to the NavMeshAgent by feeding the velocity of the agent as an animation parameter into a blend tree. Following the player is achieved by setting the agent's destination to match the player's position. Enjoy!
** Support this channel **
► / thekiwicoder
** Share this video **
► • Creating your first an...
** Subscribe! **
► / @thekiwicoder
Follow Me:
► / thekiwicoder
► www.thekiwicode...
► / thekiwicoder
► / discord
Thank you!

Пікірлер: 118
@Massive-3D
@Massive-3D 3 жыл бұрын
Wow. Today I learned I can wield the gizmo magic. I feel like Zeus!
@CosmicComputer
@CosmicComputer 3 жыл бұрын
this was brilliant, I learned so much about navigation that I just didn't comprehend before, thank you!
@adeveloper7184
@adeveloper7184 3 жыл бұрын
Ok so third person shooter and this together gonna do wonders. Make all the AI freaking genius ;)
@henrikekholm6437
@henrikekholm6437 Жыл бұрын
I've followed a lot of tutorials and ended up asking what went wrong in my childhood.. but this was just so much fun! thanks, great work!
@TheKiwiCoder
@TheKiwiCoder Жыл бұрын
You are not alone 😂
@gorrillaconvention
@gorrillaconvention 3 жыл бұрын
A note for anyone else that may have this problem. If the NavMesh won't bake. Make sure you have your meshes set to static.
@MsChemicalRebel
@MsChemicalRebel 3 жыл бұрын
Thank you! Just started and there was already a problem eheh
@gorrillaconvention
@gorrillaconvention 3 жыл бұрын
@@MsChemicalRebel Happy it helped!
@drseed2828
@drseed2828 2 жыл бұрын
Thanks, just had to put a checkmark under Object, Navigation Static, and chose to include all of the children, and that worked, for me, using the HVR platform.
@gorrillaconvention
@gorrillaconvention 2 жыл бұрын
@@drseed2828 Awesome!
@93Dynos
@93Dynos 3 жыл бұрын
We're currently making a game and this was very helpful! moving on to the rest of the series as we'll need pretty much everything you're covering!
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
Awesome! I hope these help as a reference and give you some ideas.
@irondolphin1559
@irondolphin1559 3 жыл бұрын
@@TheKiwiCoder will this work for a first person game
@GlitchVR
@GlitchVR 3 жыл бұрын
THANK YOU! Really helped me out! Thank you!
@bigboy4432
@bigboy4432 3 күн бұрын
Nice tutorial i am interested in more stuff like these
@mcboy5462
@mcboy5462 3 жыл бұрын
I searched the whole net for ai in unity for fps and i was lucky to find your video
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
Good luck, hope you enjoy!
@thebestcelep6358
@thebestcelep6358 Жыл бұрын
How are you that great of a teacher man . Great work I cant appreciate it enough
@ilkerklncarslan7146
@ilkerklncarslan7146 3 жыл бұрын
So lucky to discover this channel.
@snakeplisken4278
@snakeplisken4278 3 жыл бұрын
Make the Idle Animation so that the AI stands and looks around or shrugs a bit.
@beatrepreneur
@beatrepreneur 2 жыл бұрын
Thank you Im building a 3d game with success thanks to your videos and instructions. Keeper coming.
@marveII0us
@marveII0us 3 жыл бұрын
This content is so underrated :( Keep the awesome tutorials coming :D
@eladonstar2721
@eladonstar2721 3 жыл бұрын
Now the player got some good company...
@diliupg
@diliupg 3 жыл бұрын
Hey! I am on #05 of the 3rd. Person Shooter series. Eagerly awaiting to start this series in the near future. Your videos are to the point! LIke a Raycast! Excellent!
@rcdemoral1982
@rcdemoral1982 2 жыл бұрын
Hey thanks for this video - coming in handy, thanks!
@oozly9291
@oozly9291 3 жыл бұрын
What a great series
@b9boy
@b9boy 2 жыл бұрын
this is AMAZING
@zorkie7
@zorkie7 2 жыл бұрын
Brilliant. Thanks!
@3bomb
@3bomb Жыл бұрын
Thanks pal
@hansvallee9558
@hansvallee9558 Жыл бұрын
Thanks a lot for this great video!
@drr1867
@drr1867 3 жыл бұрын
Wow - you are amazing. Thank you so much.
@baby-sheesh
@baby-sheesh 6 ай бұрын
very very very good explanations.
@milknodev
@milknodev 2 жыл бұрын
Amazing vid!
@dansim3876
@dansim3876 2 жыл бұрын
Thank you! now i can finally go to sleep for today!
@fred1541
@fred1541 5 ай бұрын
Thanks, I really learn a lot
@drnow3621
@drnow3621 3 жыл бұрын
Thanks for this new series. Easy to understand and clear as usual. It would have been nice if you enlarged the code text slightly. It is difficult to read, especially on my iPad.
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
Yes apologies for that, will make sure to do that for the next videos!!
@eliburwell3109
@eliburwell3109 2 жыл бұрын
Your amazing man i just needed to know how to move my npcs and creatures and i could not find specfically the problem i was having you have solved a massive barrier for me.
@diliupg
@diliupg 2 жыл бұрын
This video is fantastic! It would have been fantabulous if you incorporated enemy avoid player if player ran towards the enemy too. But as it is it is the best on the subject matter so far! (Still not too late to incorporate that in a later video.. :) )
@angryhead7639
@angryhead7639 3 жыл бұрын
Thanks I just need it and you make it Thank you very much
@revoblam7975
@revoblam7975 Ай бұрын
i don't know why, but my AiAgent isn't moving at all even though the code is supposed to make it do that. did they change how it works in unity 2022?
@d0c_dev
@d0c_dev 3 жыл бұрын
just found out your channel amazing tutorials keep up!
@TheTrolderia
@TheTrolderia 6 ай бұрын
Great video man - On my way to the next one :) Just a question, if a want a character to run to a door and then i opens automatic, how can i set the door to baked, so the AI knows it can run towards the door and the through it went it opens? - Long question i know :D Hope you can explain or point me to a place to read up on it :)
@maitrykotak3703
@maitrykotak3703 4 ай бұрын
this is wonderful,,,,will you please help me if i want to give a gun in characters hand...basically making a third person shooter game....is there any video link available?
@DZ_97
@DZ_97 7 ай бұрын
this is brilliant but the enemies and players are now falling through the terrain i just made
@DeadHandRed
@DeadHandRed Жыл бұрын
nice, ta
@DhayaDevan
@DhayaDevan 3 жыл бұрын
Thanks for another awesome tutorial. Can you tell me how to change the character without losing everything ?
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
Hey sorry not sure what you mean here. Try discord for this one.
@DhayaDevan
@DhayaDevan 3 жыл бұрын
Ok thanks
@drseed2828
@drseed2828 2 жыл бұрын
Hello, I had success, using the Navigation Mesh Agent, but my animated characters do not move, after applying the Locomotion Script. The animation (AiAgent) does follow my 'Player' but doesn't walk, run sprint or move in an idle manner. I used custom animation characters, in which I added the rig, using Mixamo. I also used one skinned character, to apply skin to the rest of my animations, based on the same character. Any ideas on how to get my Mixamo characters to animate would be appreciated.
@drseed2828
@drseed2828 2 жыл бұрын
To kind of answer my own question: I used the Mixamo animations by not using 'blend tree', and instead used a bunch of transitions, and used different Speed values, to navigate between the animations. I also have the Mixamo animation 'checked' to loop and unchecked 'has exit time' on the animations that need to stop, and change to another one, abruptly. I also unchecked 'apply root motion' in the AI agent character. I'm sure there is a better way, this is more of a workaround.
@CarpathianWasteGroup
@CarpathianWasteGroup 2 жыл бұрын
Hey! Is this the player from your Unity Third Person Shooter - Using Animation Rigging series?
@ethanwebb2035
@ethanwebb2035 3 жыл бұрын
I think I am doing something wrong, in the blend tree the speed parameter isn't changing when the AI moves which means that the animations do not change from idle, I then get an error message that says "NullReferenceException: object reference not set to an instance of object" can anyone help? Never mind I fixed it I accidentally put a dot instead of an equals when identifying the animator. Thanks for the great vids they are really helpful for my college project where I am making a melee combat fighting game.
@romanbaranov1984
@romanbaranov1984 2 жыл бұрын
Thanks for the tutorial! I'm watching this on 12.2021. I have a problem with very slow NawMeshAgent rotation and movement when I push the "Play" button. Solved it by putting agent.destination = player.transform.position out of Unity Update() and put it inside Start(). I think the Unity team updated this functionality.
@JSHStudios
@JSHStudios 3 жыл бұрын
Great tutorial can you provide the project on github?
@ubabu5570
@ubabu5570 3 жыл бұрын
I also needed bro
@ianfarrell1182
@ianfarrell1182 3 жыл бұрын
Did you create the default yellow character, or can it be downloaded? Thanks for the great videos.
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
Hey, I created that yellow guy. The source files and assets are available via patreon. Link in the description! Thanks 😊
@ianfarrell1182
@ianfarrell1182 3 жыл бұрын
@@TheKiwiCoder That model would be in the blender membership, not the unity membership, right?
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
​@@ianfarrell1182 The .blend project file for the model is in the blender tier only. The exported .fbx is included in both blender and unity tiers.
@TheTrolderia
@TheTrolderia Ай бұрын
The Ai keeps pushing my character, how do i prevent that? So he can change to a different animation
@Baelidrom
@Baelidrom 2 жыл бұрын
Any tips on how to make this works while keeping "root motion" on the AI?
@mrmachinehead8059
@mrmachinehead8059 Жыл бұрын
So far, the videos great! My only issue is on the Zombie I got from Mixamo, the animator doesn't have anything for the Avatar field and I don't know what to put there...I can't seem to put anything there... Any help would be great!
@amirulhakim3359
@amirulhakim3359 7 ай бұрын
you need to create one avatar from the rig, in the inspector settings
@computergraphicscom
@computergraphicscom 5 ай бұрын
Where did you the opening scene from?
@der-Dritte
@der-Dritte 8 ай бұрын
Where you got that model
@brucewayne9434
@brucewayne9434 2 жыл бұрын
My Blend Tree is always stuck in Idle State any clues what might be wrong?
@papahoho3521
@papahoho3521 2 жыл бұрын
i set up all the animations and script but the idle animation doesnt play and the model keeps running on a spot please help
@babybananawe
@babybananawe 2 жыл бұрын
when i do it, the enemy plays the animation but doesn’t move
@ragnorucca6637
@ragnorucca6637 Жыл бұрын
hey im new to unity. How do you run the game like you did here but from an observers point of view when you were testing the path calculating and gizmos? also my path tracking line or anything really doesnt show up from the debug script when im running my game :(
@TheKiwiCoder
@TheKiwiCoder Жыл бұрын
The game view will launch automatically, but you can switch back to the scene view to fly around. Also you can disable that behaviour kinda by right clicking the play icon
@talalbow
@talalbow 2 жыл бұрын
i tried literally everything and the navmesh agent just wouldnt move at all turns out the problem was obstacle avoidance 🤦‍♂️ just turn it off completely like in the video haha
@prazo_20
@prazo_20 Жыл бұрын
May I know where you got these animations
@bymehmetyildiz
@bymehmetyildiz 9 ай бұрын
Hi Everyone, enemy character is jittering while we go same direction. Does anybody know why ?
@der-Dritte
@der-Dritte 8 ай бұрын
Hey did you use fixed update? Maybe it might wotk
@user-nb2kv9ye3y
@user-nb2kv9ye3y 8 ай бұрын
i don't have nav mesh agent
@kevinlong5104
@kevinlong5104 2 жыл бұрын
Hi, I followed exactly your steps and used the same codes. Yet right now my NPC animation does not change when its speed changes. For example, when it collides with the player and stop moving it still plays the running animation and won't change into idel as you showed in the video. Please help!
@KiritJain-ww4zk
@KiritJain-ww4zk 4 ай бұрын
Have you find a solution for this problem??
@thegamingmonster8061
@thegamingmonster8061 Жыл бұрын
what are these 3d models i want them pls
@Lopeanti
@Lopeanti 10 ай бұрын
its not working anymore?
@JackaldudeVR
@JackaldudeVR 3 жыл бұрын
Very good tutorial but I’m having an issue where my agent won’t follow my player prefab. It’ll follow the player if I drag over the player straight from my scene but it won’t if I drag the player from my prefab folder. I even deleted the original player prefab and save my scene player as the new player prefab and it still won’t follow. It also won’t let me save the agent as a prefab if I currently have the scene player selected as the transform target. I know that was a lot but any help would be great lol
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
The player must be assigned from the scene, not the prefab itself.
@JackaldudeVR
@JackaldudeVR 3 жыл бұрын
@@TheKiwiCoder ok good to know I’m not crazy. Thanks a lot!
@mr.giray1542
@mr.giray1542 Жыл бұрын
cant do the debugNav part... others ae all good tho! if anyone know what does "Assets\Infima Games\Low Poly Shooter Pack\Code\Scriptable\FeelPreset.cs(37,31): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive)." means feel free to telme how can ı fix it.
@TNCGamer
@TNCGamer 2 жыл бұрын
help pls..my npc doesnt turn when he is walking or running
@arionpaul6208
@arionpaul6208 3 жыл бұрын
Why you didn't use coroutine when you made timer?
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
Coroutines are expensive
@arionpaul6208
@arionpaul6208 3 жыл бұрын
@@TheKiwiCoder wow, i didn't know. Thanks 😊!
@basimabbasofficial1899
@basimabbasofficial1899 Жыл бұрын
thank yo thank you thank you thank you !!!!!!!! ........
@hieptranngoc2584
@hieptranngoc2584 3 жыл бұрын
could you share the project :3 thanks
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
The project files are on Patreon if you’re interested. Link in the description, Thanks!
@user-qr5dw5pj2d
@user-qr5dw5pj2d Жыл бұрын
where is the model from?
@OpxGames
@OpxGames Жыл бұрын
if you pick a player thats built wrong this will not work u will side walk. hope this helps any one
@mygamingimagination8173
@mygamingimagination8173 Жыл бұрын
hey man so i for some reason just cant create a navmesh unless i use a special navmesh components scripts. any idea on why that is.
@mygamingimagination8173
@mygamingimagination8173 Жыл бұрын
not only that my character just starets to fly when i hit play
@TheKiwiCoder
@TheKiwiCoder Жыл бұрын
Maybe convert to flight sim game instead?
@mygamingimagination8173
@mygamingimagination8173 Жыл бұрын
@TheKiwiCoder I appreciate it and also I fixed the problem I had a component on the wrong object for somereason so everytime the ai moves the names moved with it
@joecraft9098
@joecraft9098 2 жыл бұрын
nice tutorial. also RIP 69 comments
@ilkerklncarslan7146
@ilkerklncarslan7146 3 жыл бұрын
When I click to Bake nothing happens. Doesnt give error or any message. Anyone know why it doesnt work ?
@ilkerklncarslan7146
@ilkerklncarslan7146 3 жыл бұрын
Ground objeects needed to set as Static. Solved my problem.
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
Nice! The other thing to check is ‘navigation static’ is set inside the static drop down menu, It’s kind of hidden.
@itzjackthedog09
@itzjackthedog09 3 жыл бұрын
are there any assets i can get for free for these animations?
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
Mixamo.com
@TenYearsOldGamer
@TenYearsOldGamer 2 жыл бұрын
❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤
@wardtheiii
@wardtheiii Жыл бұрын
can i download this?
@TheKiwiCoder
@TheKiwiCoder Жыл бұрын
Yes it’s available on Patreon, link in the description 🙂
@twihigh279
@twihigh279 3 жыл бұрын
''SetDestination'' can only be called on an avtive agent that has been placed on a NavMesh pls help
@TheKiwiCoder
@TheKiwiCoder 3 жыл бұрын
Hey it’s because the nav mesh agent is being disabled during rag doll, easily fixed by a simple check for isEnabled before setting the destination.
@twihigh279
@twihigh279 3 жыл бұрын
@@TheKiwiCoder and how do i do that? im pretty bad at coding so i dont kno
@twihigh279
@twihigh279 3 жыл бұрын
nvm i got it
@d0c_dev
@d0c_dev 3 жыл бұрын
for those wondering you have to set the ground as static, just select the prefab and look on the inspector, took me a while to solve it
@user-wz5gw8ef3w
@user-wz5gw8ef3w 11 ай бұрын
cant access navmesh
@der-Dritte
@der-Dritte 8 ай бұрын
Wdym explain
@user-wz5gw8ef3w
@user-wz5gw8ef3w 8 ай бұрын
@@der-Dritte Its fixed, thanks. I was a noob
@der-Dritte
@der-Dritte 8 ай бұрын
@user-wz5gw8ef3w hey comerade. My friends and I are building a sort of zombie game wanna join? We will start production in 2 weeks as we have schoold
@idiotguyREAL
@idiotguyREAL Жыл бұрын
Hey can you paste the code? I can't see the code very well...
@TheKiwiCoder
@TheKiwiCoder Жыл бұрын
Patreon
Unity line of sight checking using sensors [AI #08]
19:24
TheKiwiCoder
Рет қаралды 53 М.
The Giant sleep in the town 👹🛏️🏡
00:24
Construction Site
Рет қаралды 20 МЛН
managed to catch #tiktok
00:16
Анастасия Тарасова
Рет қаралды 42 МЛН
ROLLING DOWN
00:20
Natan por Aí
Рет қаралды 10 МЛН
WHO CAN RUN FASTER?
00:23
Zhong
Рет қаралды 43 МЛН
How To Animate Characters In Unity 3D | Animation Layers Explained
16:00
How to code SMARTER A.I. enemies | Unity Tutorial
32:49
This is GameDev
Рет қаралды 52 М.
How to Add a Field of View for Your Enemies [Unity Tutorial]
23:45
Comp-3 Interactive
Рет қаралды 86 М.
Risking my life to save $5000
19:29
Linus Tech Tips
Рет қаралды 1,1 МЛН
What's Behind the Star Wars Prequels Backlash?
12:13
Adam Savage’s Tested
Рет қаралды 8 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,5 МЛН
The Giant sleep in the town 👹🛏️🏡
00:24
Construction Site
Рет қаралды 20 МЛН