Patrolling AI in Unity with C#

A quick tutorial on making a patrolling AI in Unity.
Music: Lasers by Amsterdam

Пікірлер: 64

  • @yaqingcao4817
    @yaqingcao48172 жыл бұрын

    This is the best patrol ai tutorial i found. Easy, simple, straightforward instructions. Very good for beginners and easy to do more based on this script.

  • @migueldc6845
    @migueldc6845 Жыл бұрын

    Oh heck, your so calm and to the point. Thats really refreshing :) Thank you!!

  • @SassyPantsy
    @SassyPantsy Жыл бұрын

    Perfect, Simple, straight forward, quick to set up. Perfect for prototyping.

  • @buriedbones-nh9xr
    @buriedbones-nh9xrАй бұрын

    Soothing voice thanks mate

  • @kiaora2601
    @kiaora2601 Жыл бұрын

    Thank you a lot! straight to the point and very clear explanation!

  • @carlabalos3884
    @carlabalos38842 жыл бұрын

    Thanks! Easy to follow and short tutorial.

  • @lazyhsn
    @lazyhsn2 жыл бұрын

    Thank you man. It is very simple and easy solution.

  • @rudyramadhana4127
    @rudyramadhana4127 Жыл бұрын

    thank you, it worked flawlessly!

  • @GLXY_SHADOW
    @GLXY_SHADOW Жыл бұрын

    It works really good. thank you so much

  • @borhf
    @borhf2 жыл бұрын

    this is very helpful thanks for the tutorial

  • @trailsnail
    @trailsnail Жыл бұрын

    voice so smooth

  • @valeronbaleron836
    @valeronbaleron8362 жыл бұрын

    Oh my god man, my teaher tried to explain it to us during 30 minutes and anybody got when you made that in 5 minutes! You are soooo gooood, thanks god that found your video! Defenitely like!!!

  • @thebestcelep6358
    @thebestcelep6358 Жыл бұрын

    Good and simple video I hope I learn other tips from you .

  • @MoTivE-pw9hb
    @MoTivE-pw9hb Жыл бұрын

    Amazing tutorial got my enemy characters walking in my scene!! now onto learning how to get them chasing and attacking 😉

  • @h2acomunicacion
    @h2acomunicacion3 жыл бұрын

    How I can Implementating this to enemy chomper in 3d GameKit? is to hard put a patroll script in this enemy?

  • @MaidGameStudios
    @MaidGameStudios11 ай бұрын

    very helpful ! very cool ! very thanks !

  • @PeterSedesse
    @PeterSedesse5 ай бұрын

    You should always use a timer so that if your agent can't reach a waypoint it doesn't get stuck. If the timer gets to zero, you select a random waypoint as the new target.

  • @ercuttogameplay
    @ercuttogameplay Жыл бұрын

    Thanjs my friend clear and easy

  • @K1ngCaden
    @K1ngCaden Жыл бұрын

    is there anyway to make it where if the player is a certain distance from the enemy, the enemy starts following the player until the player reaches a certain distance away from the enemy?

  • @nickfai9301
    @nickfai9301 Жыл бұрын

    Thanks for sharing this tutorial. Let say I use generic type of animal as the enemy. Can the animal move with it animation movement?

  • @pedra727
    @pedra7272 жыл бұрын

    Ur the best, Thanks!!!!

  • @user-os1jy5en1t
    @user-os1jy5en1t Жыл бұрын

    Thank you very much...!

  • @CarlosGonzalez-mz2tf
    @CarlosGonzalez-mz2tf11 ай бұрын

    anyone know how to make the ai stop for about 5 sec at each waypoint? im just having trouble knowing where to tell it to set the move speed to 0 for a few sec

  • @Geckotr
    @Geckotr Жыл бұрын

    When you use navmesh on a single plane it bakes it perfectly but when you use it on a level made out of numerous separate objects, it doesn't work so well. The solution i found for this is to place a plane to the places like a corridor where the navmesh agent couldn't bake the navmesh. Is there a better solution for this ? Btw is navmesh the only technique for the enemy AI in Unity and other APIs like UE use the same technique as well? Also thx for the great video, it helped me a lot in my project and for my learning experience in Unity

  • @requiem_for_a_dream5463
    @requiem_for_a_dream5463 Жыл бұрын

    Thank you

  • @APRIANSYAHAV
    @APRIANSYAHAV2 жыл бұрын

    whre can i dnwload this file

  • @prabhun8
    @prabhun82 жыл бұрын

    Cool

  • @V0rtex66
    @V0rtex66 Жыл бұрын

    my character stops at the first point, although he did the same as in the video

  • @davidnilsson2198

    @davidnilsson2198

    Жыл бұрын

    I had the same problem. For me the issue was that the "collider" for the NavMeshAgent was too far up on the Y-axis. Changing the offset on the NavMeshAgent (or changing the minimum distance in Update) helped.

  • @Tail1704

    @Tail1704

    Жыл бұрын

    @@davidnilsson2198 this didn't help. do you know any other way to fix this?

  • @newerr497

    @newerr497

    Жыл бұрын

    change Stopping Distance in Nav mesh Component equal 0

  • @Keuneollie

    @Keuneollie

    Жыл бұрын

    Have you found a solution?

  • @V0rtex66

    @V0rtex66

    Жыл бұрын

    @@Keuneollie yes, NewErR has already written above how to fix it

  • @paulojohnfernandez7380
    @paulojohnfernandez7380 Жыл бұрын

    My enemy object is moving but it went through the wall

  • @obisvanainobis9950
    @obisvanainobis9950 Жыл бұрын

    dosent work for me, stops at the first waypoint. I see several people have the same problem but no definitive solution

  • @robro498
    @robro4982 жыл бұрын

    I've used this code for my enemy, but how do i then give him a walk animation instead of sliding?

  • @whoami.....

    @whoami.....

    Жыл бұрын

    just set "ur_walk_anim_name" as default and change it when enemy will shoot/hit/run etc. hope it'll work if you didn't figured it out!

  • @trecheris
    @trecheris3 жыл бұрын

    im getting a AI' does not exist in the namespace`UnityEngine. Im new to unity and failing to understand what i find when i google it. Any tips here?

  • @trecheris

    @trecheris

    3 жыл бұрын

    I got it working, Was a simple coding error lol. Thanks for the video iv followed.

  • @jadonstudios777
    @jadonstudios777 Жыл бұрын

    if anyone sees this, I have been trying this for hours and every time i try, the enemy will only go to the first waypoint. Can someone please help me

  • @irenesanchez8793

    @irenesanchez8793

    Жыл бұрын

    Same here, I have no idea why. For some reason the index is not incremented

  • @Keuneollie

    @Keuneollie

    Жыл бұрын

    Have you found a solution?

  • @jadonstudios777

    @jadonstudios777

    Жыл бұрын

    @@Keuneollie well i did but my computer got blue screened and all my progress was gone.

  • @obisvanainobis9950

    @obisvanainobis9950

    Жыл бұрын

    wtf did you do to your PC

  • @jadonstudios777

    @jadonstudios777

    Жыл бұрын

    @@obisvanainobis9950 I think it was a virus but idk 🤷‍♂️

  • @lujainalmutlaq905
    @lujainalmutlaq905 Жыл бұрын

    thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks

  • @SachalSpeaksOfficial
    @SachalSpeaksOfficial2 жыл бұрын

    please make video while developing the game

  • @sillyninja65
    @sillyninja65 Жыл бұрын

    Way points seem super inefficient especially for open worlds and sandboxes

  • @pimpoplays
    @pimpoplays2 жыл бұрын

    please, full script to download????

  • @pixofobico

    @pixofobico

    2 жыл бұрын

    same

  • @pimpoplays

    @pimpoplays

    2 жыл бұрын

    @@pixofobico marlom! i founded a easyer tutorial, that does the same thing !!! if you want, i will pass the link!!

  • @pixofobico

    @pixofobico

    2 жыл бұрын

    @@pimpoplays I want it

  • @pimpoplays

    @pimpoplays

    2 жыл бұрын

    @@pixofobico kzread.info/dash/bejne/h6p409Cbmqirkc4.html here, or just search How to make an enemy follow player - Unity NavMesh

  • @pimpoplays

    @pimpoplays

    2 жыл бұрын

    @@pixofobico i know is Enemy follow but you can use for other things!!!

  • @herdboy83
    @herdboy832 жыл бұрын

    idk why it's not working and i dont have error :)^:) ): :) :)

  • @jonatassantosdasilva6495

    @jonatassantosdasilva6495

    2 жыл бұрын

    You need to call the method UpdateDestination() in the start

  • @tjorloski1961

    @tjorloski1961

    Жыл бұрын

    @@jonatassantosdasilva6495 That worked for me, thanks!

  • @AriShooDesigns

    @AriShooDesigns

    Жыл бұрын

    @@jonatassantosdasilva6495 This worked for me as well, thank you so much!

  • @lawrenceparry8921
    @lawrenceparry89213 жыл бұрын

    First.

  • @mehrshadking7840
    @mehrshadking7840 Жыл бұрын

    this way has a bug dont test