How to make a Monster Pathfinding AI - Roblox Studio 2022

Поделиться
HTML-код
  • Опубликовано: 7 июл 2024
  • Roblox Model 📦: www.roblox.com/library/135911...
    Script📜: pastebin.com/QS0XRPW0
    My discord: Telemacos#8418
    My roblox account: www.roblox.com/users/40740165...
    Talent Hub: talent.roblox.com/creators/40...
    ------------------------------
    chill. by sakura Hz / sakurahertz
    Creative Commons - Attribution 3.0 Unported - CC BY 3.0
    Free Download / Stream: bit.ly/chill-sakuraHz
    Music promoted by Audio Library
    • Chill - sakura Hz (No Copyright Music)
    ------------------------------
    0:00 Coding
    23:20 Testing
  • ИгрыИгры

Комментарии • 323

  • @sakuraangel7333
    @sakuraangel7333 10 месяцев назад +17

    This has taught me a lot, and it's so helpful you actually talked through the script, not just telling us to paste it from the description (and thank you for still putting it in description, I got to paste it in and learn from where I didn't understand, saving time.). Thank you!

    • @lekopoy
      @lekopoy 5 месяцев назад +2

      Same here, most of the tutorials I found on making an npc were just grabbing a model and showing you how to change the appearance.

  • @Bloxmane
    @Bloxmane Год назад +2

    i really like your voice and script skills, man u deserve more!

  • @Marcusthedawg7722
    @Marcusthedawg7722 9 месяцев назад +1

    Bro tysm, u rlly taught me rlly much in this vid

  • @StupidMiners
    @StupidMiners 2 месяца назад

    W man I WAS LOOKING FOR THIS EVERYWHERE! I was making a game. And i had lots of problems but you helped me fixed all of them THANKS! W New subscriber

  • @Nikoverso
    @Nikoverso Год назад +2

    Thanks for this video, you r amazing ❤️

  • @ClassicDev123
    @ClassicDev123 Год назад

    Holy THX DUD LOVE IT SO MUCH!!!

  • @combatwarrior684
    @combatwarrior684 3 месяца назад +1

    thanks, helped me a lot

  • @TrashDev_RBX
    @TrashDev_RBX Год назад

    Thank you, that helped me SO MUCH!!

  • @r0cket596
    @r0cket596 Год назад

    Lets go! 🤩

  • @_RV397
    @_RV397 3 месяца назад +1

    tysm ! bro helped me you are the best scripting man !

  • @Kaazmaz3447
    @Kaazmaz3447 Год назад

    TYSM UR THE BEST U DESERVE A SUB

  • @rayestrz
    @rayestrz 6 месяцев назад

    VERY USEFUL!

  • @iRevz
    @iRevz Год назад

    Your The BEST BRO u just got a new Subscriber :>

  • @Werteux
    @Werteux Год назад +9

    Thank you very much, I was struggling with this for a month. This film helped me a lot ... Greetings from Poland.

  • @BallsBoii
    @BallsBoii 9 месяцев назад

    BRO I LOVE YOU I HAD ALWAYS PROBLEM WITH MY AI BOT BROO YOU JUST SAVED ME THANKSSSSSS

  • @SlothOfTheSea
    @SlothOfTheSea Год назад +7

    Teletacos, if I could give you a million dollars, I would, because you just saved me so much frustration with the pathfinding lag glitch. I had no idea SetNetworkOwner was a thing. Thank you so much!

  • @fejsalkusmic6137
    @fejsalkusmic6137 2 месяца назад

    The best tutorial I have found so far, thank you for this vid, it's very useful

  • @Laterway
    @Laterway Год назад

    Hi im a begginer for developing thank you for this it helped me so much!

  • @user-xd2ie9dd1c
    @user-xd2ie9dd1c 7 месяцев назад

    It is great! Thank you a lot!

  • @ricktherickrolled
    @ricktherickrolled Год назад

    UNDERRATED!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Thank you so much!!!!!! I will credit you

  • @Adam-jq8dm
    @Adam-jq8dm Год назад

    Wow thank you so much!!!

  • @wigglywax1798
    @wigglywax1798 Год назад +4

    Bro this guy deserves more subs than he has. It's so difficult to find open source code. Thanks for the vid!

  • @vectorgarman
    @vectorgarman Год назад

    really nice

  • @porta1master096
    @porta1master096 Год назад +7

    This Video actually helped me so much, i can work on my horror game in actual horror so that, the monster can actually go past you when your in a closet. ("Creepy: Rebirth" is what it's called the third version of my previous two one from 2020 and one "Creepy: Reborn" and for this new installment it's advanced now, you can probably do things that isn't usually in horror games like peeking left and right or just the lore in General. Probably)

    • @173sawYT
      @173sawYT 11 месяцев назад

      sounds interesting

  • @Gaazzee
    @Gaazzee Год назад +1

    I am making a child like horror game this will be amazing! TY!

  • @Vortex-owns-rig
    @Vortex-owns-rig Год назад

    it has a fear of hights like it wont go on terrain like rock its has bumps that block it from moving mainly the indents in the ground

  • @movfile.
    @movfile. 10 месяцев назад

    cool intro

  • @orientinc.
    @orientinc. Год назад

    Your content is underated and advance

  • @FlawLessPixel
    @FlawLessPixel Месяц назад

    I love vids like theese personally i dont just wanna paste the script i wanna learn how it works and to make it for the future

  • @TheAmazingRobloxDev
    @TheAmazingRobloxDev 10 месяцев назад +5

    If your having broblems with (BlackList) in the script then change BlackList to Exclude.

  • @jdlrangerstudios
    @jdlrangerstudios Год назад +4

    Thank you for allowing me to copy paste it saved so much time!

  • @Shadow_God563
    @Shadow_God563 Год назад +33

    After the NPC kills a Player, it just sits there and doesn't move back to the Waypoints, is there a way to fix this?

    • @Zyplexx
      @Zyplexx 10 месяцев назад +6

      Yes to fix this error you have to set the player respawn time to less than 0.2.

    • @SrSealKing
      @SrSealKing 9 месяцев назад +1

      @@ZyplexxIt looks like u know some stuff about this script and I was wondering why most of it is lined red when I didn’t make any mistakes?

    • @Zyplexx
      @Zyplexx 9 месяцев назад

      @@SrSealKing you can copy the link from description and make sure your animations and stuff are titled right

    • @Zyplexx
      @Zyplexx 9 месяцев назад

      @@SrSealKing get everything done first then check if script works

    • @Rolpro_fans
      @Rolpro_fans 9 месяцев назад

      😂I was laughing when that thing site and found nothing looks like that monster is sad 😂

  • @TheAmazingRobloxDev
    @TheAmazingRobloxDev 10 месяцев назад

    you can make a realistic horror game series

  • @noahandsceciliasadventures8726

    I’m going to try this script on my own game when I get home 😲

  • @patrickaguilar6028
    @patrickaguilar6028 Год назад +11

    Can you teach how to make a player be able to create the waypoints for the AI? Thanks for the tutorial.

    • @Oxidinite
      @Oxidinite Год назад

      you basically shoot poop out your arse and then flush the garden

    • @ItsOfficialArano
      @ItsOfficialArano 10 месяцев назад +1

      Click on element and do square, put couple of squares and select them all, left click, select file. Then name the file waypoints and be sure they anchored and have cancollide off so the bot wont be stuck

    • @ItsOfficialArano
      @ItsOfficialArano 10 месяцев назад

      Thats how you make the waypoints :)

  • @urcaburra670
    @urcaburra670 Год назад

    cooool

  • @DeltaPrecise
    @DeltaPrecise 7 месяцев назад +1

    tele could you make a tutorial on how to make it transform into the player after they get killed?

  • @dev_axel
    @dev_axel 3 месяца назад +2

    Not bad, however when I enter any maze/building and it hits a wall it instantly breaks without any error/print/warning message. Any way to fix this annoying issue?

  • @hjl_1625
    @hjl_1625 Год назад +17

    Its good, but when it goes to certain points, it stops after going to them. It only goes to 2 waypoints and none of the others. after doing this for a few times it stops and doesnt do anything but play the animation

    • @zaaaccccc
      @zaaaccccc 11 месяцев назад

      did you add the kill sound in the head

    • @aikious7638
      @aikious7638 11 месяцев назад

      same problem.. have you solved?

    • @Darklordhedgehog
      @Darklordhedgehog 6 месяцев назад

      i think you need to change the number he mentions in the video on the 'local randomNum = math.random(1, #waypoints)' row, you might need to change the 1

    • @Darklordhedgehog
      @Darklordhedgehog 6 месяцев назад

      @@aikious7638 i think you need to change the number he mentions in the video on the 'local randomNum = math.random(1, #waypoints)' row, you might need to change the 1

    • @LooperEpic
      @LooperEpic 6 месяцев назад

      @@Darklordhedgehogmath.random gets something between number1 and number2, so 1 wouldn’t be changed, #waypoints would be changed to allow a higher random number. So if #waypoints was 5, it would get a random number from 1 to 5, if it were 8, 1 to 8.

  • @MisterWolfOfficial
    @MisterWolfOfficial 4 месяца назад +2

    This is really cool but idk why it doesnt work. Maybei missed a bit, but i cant fix it. The code just doesnt work at all, the NPC just sits there. Sad :(

  • @TheJamaAccount
    @TheJamaAccount Год назад +3

    I've noticed that whenever I get into the game I'm testing, the animations don't work, and on top of that whenever the entity tries running over to me and dealing damage, it doesn't deal any damage and it stops him in his place, preventing him from going back to the waypoints. Do you have a fix for this?
    found a fix, get an R15 dummy from the toolbox, make sure the waypoints are inside of workspace, and not still in the part it came in, and make sure the attack sound is actually a child of the humanoids head. Hope this helps

    • @BibiGoPewpew
      @BibiGoPewpew 11 месяцев назад +1

      BRO THANK YOU SO MUCH BRO i almost forgot to get it outside of the part it came in thank god for telling me

    • @173sawYT
      @173sawYT 11 месяцев назад

      so the waypoints cant be in the Folder or it will break?

    • @TheJamaAccount
      @TheJamaAccount 11 месяцев назад

      @@173sawYT no no the waypoints need to be in the waypoint folder

    • @kaderesuggan
      @kaderesuggan 6 месяцев назад

      is there a way so i can keep R6 dummy?

  • @adgurkan
    @adgurkan 7 месяцев назад +1

    Worked well but it gave me a "Indexed nil with humanoid root part error"

  • @RobloxDev-ec5ow
    @RobloxDev-ec5ow 4 месяца назад

    Great video! What would be a easy fix for the AI running into walls

  • @calebetheredge9307
    @calebetheredge9307 Год назад

    i tried applying this to my mesh, But he just started flying backwards after the game started, i tried inserting a dummy into the mesh so that it might be able to walk around but it still didnt work! any ideas?

  • @sweetikso2
    @sweetikso2 3 месяца назад

    Hi, can you make a tutorial on how to make an NPC that reacts to sounds, for example, a fallen object? Thank you so much in advance.

  • @MatCantCode
    @MatCantCode Год назад +2

    do you know how to make the monster patrol when the player is hiding

  • @HeavyParaBeetle
    @HeavyParaBeetle 6 месяцев назад

    My monster keeps going to the same 3 points, it never goes to different ones.

  • @YuriDinizMendonca
    @YuriDinizMendonca 3 месяца назад +1

    Hello, i am having a problem that the animations are not working because in my code, in any moment animPlaying is set to true, is there a way to fix it?

  • @melty_ice
    @melty_ice Год назад

    dude nice tutor

  • @polloscappatodicasapolloid4493
    @polloscappatodicasapolloid4493 5 дней назад

    Help!!!
    My animation plays exactly after 5 seconds the player died and the camera changed position, how can I delete this waiting time or make it shorter?
    I checked the animation and it's starting on the "0" second bar.
    My script:
    --{{Services}}--
    local Players = game:GetService("Players")
    local TweenService = game:GetService("TweenService")
    --{{Variables}}--
    local player = Players.LocalPlayer
    local character = player.Character or player.CharacterAdded:Wait()
    local currentCamera = game.Workspace.CurrentCamera
    local rig = game.Workspace.JumpscareBox.GranpaModel
    local sound = game.Workspace.JumpscareBox.JumpscareSound2
    --{{Functions}}--
    local animationTrack = rig.Humanoid.Animator:LoadAnimation(script.JumpscareAnimation):Play()
    local function onDeath()
    currentCamera.CameraType = Enum.CameraType.Scriptable
    currentCamera.CFrame = rig.Head.CFrame + (rig.Head.CFrame.LookVector * 3)
    currentCamera.CFrame = CFrame.lookAt(((rig.Head.Position + Vector3.new(0, 0, 0))+(rig.Head.CFrame.LookVector * 3)), rig.Head.Position)
    local tween = TweenService:Create(currentCamera, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 13, true), {CFrame = currentCamera.CFrame + currentCamera.CFrame.LookVector * 0.5})
    tween:Play()
    task.wait(5)
    currentCamera.CameraType = Enum.CameraType.Custom

    end
    character.Humanoid.Died:Connect(onDeath)

  • @TheJamaAccount
    @TheJamaAccount Год назад

    does anyone have animation ID's for the Rthro animation pack? I can't find the locomotion ID's anywhere.

  • @thechannel7988
    @thechannel7988 Год назад

    can you create a monster that randomly attacks the player like Charles from "Choo Choo Charles" I understand that this game was made on a different game creation engine, but if possible, please do a tutorial on this

  • @saltman8975
    @saltman8975 6 месяцев назад

    It wont let me change the animation for walking. Also it stops in place for about 5 seconds a lot weather it's chasing you or just walking around
    Other than these it's pretty good

  • @zaaaccccc
    @zaaaccccc 11 месяцев назад

    My npc doesn’t jump, instead it just only goes through the other waypoints instead of the one with the part it has to jump through, is there any way to fix this?

  • @mr_nharwhale
    @mr_nharwhale Год назад

    a system message that says something is showing up. The message is:
    Network Ownership API cannot be called on Anchored parts or parts welded to Anchored parts.

    • @yanectsy
      @yanectsy Год назад

      the humanoidrootopart must be unachored

  • @173sawYT
    @173sawYT 11 месяцев назад +3

    theres a problem, when he goes far or chases the player sometimes he will randomly stop moving or chasing and he wont even go back to the waypoints

    • @aikious7638
      @aikious7638 11 месяцев назад

      same problem.. have you solved?

    • @173sawYT
      @173sawYT 11 месяцев назад

      @@aikious7638 yes

    • @aikious7638
      @aikious7638 11 месяцев назад

      @@173sawYT How ?

    • @173sawYT
      @173sawYT 11 месяцев назад

      @@aikious7638 i made my npc r15 and it worked

  • @stoneshelly7337
    @stoneshelly7337 Год назад

    I dont know why, Everything works fine but it doesnt attack. I set both to Action and the walking anim works just fine. Any help!??

  • @Blade_Sm1th
    @Blade_Sm1th 4 месяца назад +1

    Hey for some reason my NPC is not moving do you know why?

  • @MagicsMalice
    @MagicsMalice Год назад +1

    Teletacos do you add your own npc or does it come with it

  • @yannoahhc8240
    @yannoahhc8240 Год назад

    :O

  • @DarkenV1
    @DarkenV1 5 месяцев назад

    whenever the monster follows me it cant catch up cus it tries to play the animation and cant kill me anyone know how to fix?

  • @StupidMiners
    @StupidMiners 2 месяца назад

    I have a small problem. It doesn't attack me. It also stops when it hits me.

  • @Sung1-1
    @Sung1-1 Год назад

    bro when monster see me it come to position where i'm and then stuck and didn't give and damage

  • @jontheartistlive2316
    @jontheartistlive2316 Месяц назад

    The AI is easily cheesable. You can just walk behind it and it will freeze and stop moving.

  • @KSAINMOST
    @KSAINMOST 7 месяцев назад +1

    can you tell me where to place the idle animation

  • @Npridatok
    @Npridatok Год назад +1

    Unfortunately I have a Error. "Network Ownership API cannot be called on Anchored parts or parts welded to Anchored parts. - Server - AI:6"

    • @TeletacosRobloxTutorials
      @TeletacosRobloxTutorials  Год назад +1

      The HumanoidRootPart is most likely anchored, make sure to unanchor it

    • @Npridatok
      @Npridatok Год назад

      @@TeletacosRobloxTutorials Thanks a lot, everything works!

    • @Npridatok
      @Npridatok Год назад

      @@TeletacosRobloxTutorials by the way, you can develop this idea, and make the monster lose sight of the player when he is in a closet

  • @rhavols
    @rhavols Год назад

    Also I tried making another one of them but the new one doesnt move idk why

  • @gamerlayerplayer
    @gamerlayerplayer Год назад +2

    Thanks for the tutorial! BTW, is there any way you can tell me how to accelerate the monster?

    • @krishsamusementpark
      @krishsamusementpark 9 месяцев назад

      to make the monster faster go to humanoid and change it's walk speed

    • @KSAINMOST
      @KSAINMOST 7 месяцев назад

      @@krishsamusementpark he meant when the monster sees the player

    • @krishsamusementpark
      @krishsamusementpark 7 месяцев назад

      @@KSAINMOST oh ok

  • @Gond2X
    @Gond2X 7 месяцев назад

    What if u want to change anim to chase while he found u and return back while lost u walk..??

  • @DeviKai
    @DeviKai 11 месяцев назад

    I just find this for the Vision ai

  • @BloxRolling
    @BloxRolling Год назад

    To make your own animations do you use animating editor

  • @ministryray2126
    @ministryray2126 5 месяцев назад

    How would I make it so if there is a part in the Bot's path that it can't get over, then the Bot will teleport to one of it's waypoints

    • @Darklordhedgehog
      @Darklordhedgehog 5 месяцев назад

      idk, but it personally would just and wedges around it, to make it have the ability to climb over

  • @OnlyBassBoostedMusic
    @OnlyBassBoostedMusic 4 месяца назад

    How do i let the script run, if I start the game the npc does nothing at my sight.

  • @SledgerPlaysYT
    @SledgerPlaysYT Год назад +2

    Hey uhm why doesnt this work ? i added you on discord btw cause when i add the AI script to my Monster it wont move .

    • @ichad6535
      @ichad6535 Год назад

      make sure it's humanoid

  • @TheAmazingRobloxDev
    @TheAmazingRobloxDev 10 месяцев назад

    and if i want to make doors but the ai script cant detect if theres a door

  • @LibrettoGamerYT
    @LibrettoGamerYT 11 месяцев назад

    you can make a chase theme and a chase animation?

  • @jaedentu3276
    @jaedentu3276 11 месяцев назад

    I tried so many Script but they dont work on mine can someone tell me what's happening. does my Roblox Studio Glitch?

  • @Gaazzee
    @Gaazzee Год назад +1

    There is an error at line 18 did anyone figure the error out?

    • @BruhXD2
      @BruhXD2 Год назад

      Whats the error

    • @KlutchYouTube
      @KlutchYouTube Год назад

      @@BruhXD2 Its whenever you type blacklist the autofull for .blacklist is crossed out

    • @BruhXD2
      @BruhXD2 Год назад

      @@KlutchRUclips you have to replace .Blacklist with .Exclude because .Blacklist is deprecated

  • @lifetime9584
    @lifetime9584 Год назад

    Your videos are really cool and nice but you should speak louder

  • @npcsstuff2123
    @npcsstuff2123 Год назад

    Can you teach like when player out of his location hes normal moving dont follow player?

  • @minecraftlolguy6869
    @minecraftlolguy6869 Год назад +1

    for some reason the walking animation doesn't play, the attack animation works and all but not the walking anim. Can someone Please leave a reply explaining this bug

    • @gtkiscool
      @gtkiscool 11 месяцев назад

      Maybe look in the walk properties and see if there is an animation id

    • @TheLaggedAlertzz
      @TheLaggedAlertzz 11 месяцев назад

      What i did was change the walking animation to be looped in the place where you make it and coded it to stop for attack animaiton to to come then play to play it again.

  • @realzombiie
    @realzombiie Год назад

    This script does work, although there is an issue. The NPC wont jump.

  • @RappelzWikiaPolska
    @RappelzWikiaPolska Год назад

    Okey so following the wideo script didnt run at all due so many errors ( i copy every thing with caution took me like 50 min to watch video pause and write exacly what you did) how ever the code from codepaste work perfect. Apart that now i have to learn and understand this code better to enclose functions in server script so all my Enemy NPCs can use it and i dont have to re write it 1000 times for each enemy( copy/paste) Thank you

  • @GalacticPotato101
    @GalacticPotato101 3 месяца назад

    Line 18 of the code is outdated, I'm pretty sure you can replace it with this and it should still work: rayParams.FilterType = Enum.RaycastFilterType.Ignore

  • @joshanimates1990
    @joshanimates1990 Год назад

    im getting this on line 34 anyone know a solution? IsDescendant0f is not a valid member of MeshPart

  • @Marcusthedawg7722
    @Marcusthedawg7722 9 месяцев назад

    I don't understand one thing: when did you call the function "WalkTo"

  • @MrMetrivus
    @MrMetrivus Год назад +1

    It can be stuck even permanently stuck after hitting a wall.

    • @173sawYT
      @173sawYT 11 месяцев назад

      did you use r6 or r15 character?

    • @ricktherickrolled
      @ricktherickrolled 11 месяцев назад

      @@173sawYT what's the difference?

  • @MagicsMalice
    @MagicsMalice День назад

    What if the monster is a Mesh Rig?

  • @luckyface728
    @luckyface728 Год назад

    Hey how did u learn all of this pls tell me?

  • @PlanetToSkt
    @PlanetToSkt Год назад +1

    Its a replica of Gnome Code's Teddy bear script. Anyone think this doesn't work can try using this link directed to the original video: ruclips.net/video/gSYx6MVa9Tc/видео.html

  • @user-pg7bm6be5v
    @user-pg7bm6be5v 11 месяцев назад

    why does it tell me that its not right (red line under the text) in rayParams.FilterType = Enum.RaycastFilterType.Blacklist

    • @KSAINMOST
      @KSAINMOST 10 месяцев назад

      Blacklist is changed to Exclude

  • @Xx7WJCxX
    @Xx7WJCxX 3 месяца назад

    If you still keep up with this video, My monster doesnt scream and is there a way to change its speed?

    • @Really_Unreall
      @Really_Unreall Месяц назад

      I don’t know about the scream but you can change the walk speed in the humanoid properties

  • @WRAPGIFT
    @WRAPGIFT Год назад

    "how to make a Monster Pathfinding AI"
    me: goes to the comments instead

  • @TRQDakwah
    @TRQDakwah Год назад

    can you make like roblox door figure?

  • @PlayerBIU
    @PlayerBIU 2 месяца назад

    How do i make it like for a /spawn NPC command?

  • @lalmalsawmachhakchhuak4114
    @lalmalsawmachhakchhuak4114 5 месяцев назад

    what kind of version do you have 😵‍💫😵‍💫😵‍💫

  • @BroxsyGamez
    @BroxsyGamez Год назад +2

    If you don't mind me asking, do you know a fix for the 'Blacklist' command as it is marked as 'deprecated'

    • @DustyBawls.
      @DustyBawls. Год назад +3

      Yes instead of .Blacklist put .Exclude it will work

    • @BroxsyGamez
      @BroxsyGamez Год назад

      @@DustyBawls. thx soo much, this really helps

    • @dannygong1596
      @dannygong1596 10 месяцев назад

      Gracias I appreciate it

  • @jaedentu3276
    @jaedentu3276 11 месяцев назад

    idk why it dos not work for me i allready copy the sript

  • @coolestguy3124
    @coolestguy3124 3 месяца назад

    what does setting network owner to nil do?

  • @StevenBadAss
    @StevenBadAss 10 месяцев назад +1

    is there a way to remove the pause when the monster is deciding where to go next?

    • @Pixel6588
      @Pixel6588 7 месяцев назад

      While task.wait() do | Line 139

    • @StevenBadAss
      @StevenBadAss 3 месяца назад

      thanks
      @@Pixel6588