Active NavMeshAgent Avoidance - Run Away From or Around a Target | Unity Tutorial

  Рет қаралды 2,618

LlamAcademy

LlamAcademy

Күн бұрын

AI pathfinding avoidance can be tricky. In this video you'll learn the basics of enhancing the built-in NavMeshAgent avoidance to have them walk around some targets or even run completely away from them!
👨‍💻 The full project for the Chicken Defense Microgame is available on GitHub for FREE: github.com/llamacademy/chicke...
📚 Resources:
⚫ NavMeshAgent Docs: docs.unity3d.com/2023.1/Docum... & docs.unity3d.com/2023.1/Docum...
⚫ RVO2 Docs: gamma.cs.unc.edu/RVO2/
⚫ Chicken Defense on Itch.io: llamacademy.itch.io/chicken-d...
🧡 Believe in LlamAcademy's mission and have received value from the videos? Here's how you can show your support:
📚 Take my Unity ShaderGraph Course:
www.gamedev.tv/p/unity-shader...
👕 Get yourself some LlamAcademy merch: llamacademy.myspreadshop.com/
Become a Supporter:
🌟 Patreon: / llamacademy
🌟 KZbin Member: / @llamacademy or click the Join button on any video
🌟 GitHub Sponsor: github.com/sponsors/llamacademy
Use these affiliate links to do your Asset Store / Humble Bundle Shopping!
💸 Check out the latest Humble Bundles www.humblebundle.com/software...
💸 Publisher Sale! 50% OFF an entire publisher's Assets! Publisher changes weekly! assetstore.unity.com/publishe...
💸 Save up to 50% on NEW Assets: assetstore.unity.com/?new_sal...
Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.
#unitytutorial #tutorialtuesday #gamedev #tutorial #unity #llamacademy #gamedevelopment
Chapters:
00:00 Topic Introduction
00:22 NavMeshAgent Avoidance
01:07 How We'll Do It
01:44 Demo of the functionality
02:34 Active Avoidance - EnemyMoveState.cs
05:04 Run Away Configs
05:28 A Closer Look
06:08 Understanding Which Llama(s) to Run Away From
06:46 More Complex Considerations
07:32 How to Support LlamAcademy

Пікірлер: 26
@Qornv
@Qornv 20 күн бұрын
Absolute king with these in-depth tutorials
@worldkho
@worldkho 6 күн бұрын
Just what I needed
@LlamAcademy
@LlamAcademy 5 күн бұрын
Great to hear!
@jamestanubrata6782
@jamestanubrata6782 20 күн бұрын
That's so cool
@BarcelonaMove
@BarcelonaMove 20 күн бұрын
Yes ME!
@LlamAcademy
@LlamAcademy 20 күн бұрын
YES YOU 🫵! 😁
@user-ij6el8gw5y
@user-ij6el8gw5y 19 күн бұрын
I honestly don't understand why don't you have million subscribers.... Hope you will!!
@LlamAcademy
@LlamAcademy 19 күн бұрын
Thank you 🙏
@dico3557
@dico3557 12 күн бұрын
Had to tear it up for my own use, but works pretty good. Not perfect, but really good.
@Hazzel31337
@Hazzel31337 20 күн бұрын
nice video gave me an idea for a game, i used your unity asset store referal link to buy rayfire, hope it helps as a little thanks
@LlamAcademy
@LlamAcademy 20 күн бұрын
Awesome! Thank you 🙏
@vatyunga
@vatyunga 20 күн бұрын
So it's possible to make a boids like avoidance on top of desiredVelocity? And it's probably possible to completely disable acceleration using agent.velocity = desiredVelocity.normalized * _speed?
@LlamAcademy
@LlamAcademy 20 күн бұрын
I think so. BOIDS on a NavMesh is something I’ve wanted to try out for some time now but just haven’t gotten around to it. For disabling acceleration, remember desired velocity accounts for slowdowns based on the baked in avoidance. If you wanted to just move quickly to the next point it may be easier to just get the direction to the next point on the path and set the speed to be speed * directionToNextPointOnPath
@bokuwa_Tobi_0210
@bokuwa_Tobi_0210 15 күн бұрын
Bro I have got an issue. I have created an ai script which wander along random wander points over the navmesh. However, sometimes the wander points are invalid and the ai does not move to the wander point and remains stationary at his position unless I manually move it to the wander point's position from the scene view. I would be very glad if you can help me...
@LlamAcademy
@LlamAcademy 13 күн бұрын
When picking a wander location you can call NavMesh.CalculatePath and see if the status is "Complete" (or check the Agent's path). If it is "Partial" that means the agent cannot fully travel to that location
@silchasruin4487
@silchasruin4487 20 күн бұрын
Who ME? Haha, I've been kicking myself trying to figure out a more performant way to use pathfinding to avoid the jostling and overlapping of Unitys navmesh agents. I'm trying to see if I can't figure out a way to implement RVO2 type of avoidance and collision detection while piggybacking off of Unitys default NavMesh Component.
@LlamAcademy
@LlamAcademy 19 күн бұрын
Doing a custom RVO2 agent is something I've wanted to do for a long time but haven't gotten to. If you figure it out I'd love to see it 🙂
@LlamAcademy
@LlamAcademy 19 күн бұрын
Oh, and YES YOU 🫵!
@ahmedmalik2856
@ahmedmalik2856 20 күн бұрын
Your tutorial is Amazing, EVERY ON IS!!! Great Work and keep it up man! Suggestion : There seems to be background music but it's volume is very low. Your voice was overpowering it. I like tutorials with interesting music and maybe more sounds when you say something important or stuff. That way it will be more engaging like look at Dani or Thomas Brush. Cheers,
@LlamAcademy
@LlamAcademy 19 күн бұрын
Thank you for the encouragement and feedback. In the earlier videos I had the music too loud so maybe I went a little far in the other direction to make it slightly too quiet now.
@ahmedmalik2856
@ahmedmalik2856 19 күн бұрын
@@LlamAcademy You are welcome ^^ Keep up the great work. I love watching your videos and tutorials :)
@thelearner2196
@thelearner2196 20 күн бұрын
Hii bro I found a problem 😢 can you help me
@LlamAcademy
@LlamAcademy 20 күн бұрын
What’s the problem?
@thelearner2196
@thelearner2196 20 күн бұрын
@@LlamAcademy I am working on moon knight game but I face problem on transformation from man to moon knight please help me how I fix it 😔
@dkordy
@dkordy 11 күн бұрын
Can you please please dont be like others, when displaying code enlarge little bit, please. Its to dificult to see what is writhen. 😊❤
@LlamAcademy
@LlamAcademy 11 күн бұрын
It is zoomed 300%. If I pull it up on mobile and don’t go full screen I can see it’s a little small though. Maybe I’ll go a little bit more in the future
How did CatNap end up in Luca cartoon?🙀
00:16
LOL
Рет қаралды 7 МЛН
У мамы в машине все найдется
00:38
Даша Боровик
Рет қаралды 2,8 МЛН
The magical amulet of the cross! #clown #小丑 #shorts
00:54
好人小丑
Рет қаралды 24 МЛН
Agents Navigation Crowds - Unity Asset Store Review
10:43
Turbo Makes Games
Рет қаралды 2 М.
GOAP Enemy AI FULL IMPLEMENTATION | AI Series 50 | Unity Tutorial
1:10:13
88 Manim Animations in ONE Video
4:04
Michael Hammer
Рет қаралды 20 М.
INSANE shooter with WAY too many bullets (Unity ECS Tutorial) - PART 1
15:20
Sasquatch B Studios
Рет қаралды 3,9 М.
Simplified 2D Grid PATHFINDING in Godot 4.2
16:29
Cashew OldDew
Рет қаралды 8 М.
How did CatNap end up in Luca cartoon?🙀
00:16
LOL
Рет қаралды 7 МЛН