Тёмный

How to make a Monster Pathfinding AI - Roblox Studio 2022 

Teletacos Roblox Tutorials
Подписаться 1,9 тыс.
Просмотров 127 тыс.
50% 1

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 381   
@sakuraangel7333
@sakuraangel7333 Год назад
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 8 месяцев назад
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.
@TheAmazingRobloxDev
@TheAmazingRobloxDev Год назад
If your having broblems with (BlackList) in the script then change BlackList to Exclude.
@Darklordhedgehog
@Darklordhedgehog 9 месяцев назад
thank you!
@TheAmazingRobloxDev
@TheAmazingRobloxDev 9 месяцев назад
@@Darklordhedgehog your welcome
@Tettzz
@Tettzz Месяц назад
I did this instead of the raycast and it works local touchConnection touchConnection = plrHitbox.Touched:Connect(function(partHit) for _, guardChild in pairs(guard:GetChildren()) do if partHit == guardChild and guardChild:IsA("MeshPart") and canTouch and targetReached == false then canTouch = false task.cancel(thread) targetReached = true print("Player hit by Guard") char.Humanoid.Health = 0 touchConnection:Disconnect() end end end)
@Cookie-t8m
@Cookie-t8m 21 день назад
Which raycast?
@HysodDjdjd
@HysodDjdjd 20 дней назад
Which raycast
@Werteux
@Werteux Год назад
Thank you very much, I was struggling with this for a month. This film helped me a lot ... Greetings from Poland.
@TeletacosRobloxTutorials
@TeletacosRobloxTutorials Год назад
Im glad I could help
@rashy15
@rashy15 Год назад
a month?? 💀 bro youre sped
@Werteux
@Werteux Год назад
@@rashy15 ?
@kingaartdamiankasprzyk3557
@kingaartdamiankasprzyk3557 Год назад
Im from Poland
@kingaartdamiankasprzyk3557
@kingaartdamiankasprzyk3557 Год назад
Hi = hej great = fajne bye = papa good = dobrze polish translator = polski tłumacz My Polish translator
@Nikoverso
@Nikoverso Год назад
Thanks for this video, you r amazing ❤️
@italaakk
@italaakk Год назад
niko???? vc aqui
@nyawzino9153
@nyawzino9153 Год назад
nico fazendo jogo pro roblox
@Shadow_God563
@Shadow_God563 Год назад
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 Год назад
Yes to fix this error you have to set the task.wait() time to less than 0.2.
@SrSealKing
@SrSealKing Год назад
@@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 Год назад
@@SrSealKing you can copy the link from description and make sure your animations and stuff are titled right
@Zyplexx
@Zyplexx Год назад
@@SrSealKing get everything done first then check if script works
@Rolpro_fans
@Rolpro_fans Год назад
😂I was laughing when that thing site and found nothing looks like that monster is sad 😂
@StupidMiners
@StupidMiners 5 месяцев назад
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
@SlothOfTheSea
@SlothOfTheSea Год назад
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!
@TeletacosRobloxTutorials
@TeletacosRobloxTutorials Год назад
Glad I could help!
@ahmedahmed-lr6nf
@ahmedahmed-lr6nf Год назад
you will give him million dollars ? T----T
@Bloxmane
@Bloxmane Год назад
i really like your voice and script skills, man u deserve more!
@Marcusthedawg7722
@Marcusthedawg7722 Год назад
Bro tysm, u rlly taught me rlly much in this vid
@Gaazzee
@Gaazzee Год назад
I am making a child like horror game this will be amazing! TY!
@porta1master096
@porta1master096 Год назад
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 Год назад
sounds interesting
@NI_KKU
@NI_KKU Месяц назад
Casually destroys the computer in the intro
@_RV397
@_RV397 6 месяцев назад
tysm ! bro helped me you are the best scripting man !
@hjl_1625
@hjl_1625 Год назад
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 Год назад
did you add the kill sound in the head
@aikious7638
@aikious7638 Год назад
same problem.. have you solved?
@Darklordhedgehog
@Darklordhedgehog 9 месяцев назад
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 9 месяцев назад
@@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 9 месяцев назад
@@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.
@storylynnegoss1565
@storylynnegoss1565 Месяц назад
Just make sure you don't add to many path Monsters because they tend to collide with each other and makes them fall over
@TRKNETZ
@TRKNETZ Год назад
BRO I LOVE YOU I HAD ALWAYS PROBLEM WITH MY AI BOT BROO YOU JUST SAVED ME THANKSSSSSS
@combatwarrior684
@combatwarrior684 6 месяцев назад
thanks, helped me a lot
@patrickaguilar6028
@patrickaguilar6028 Год назад
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 Год назад
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 Год назад
Thats how you make the waypoints :)
@jdlrangerstudios
@jdlrangerstudios Год назад
Thank you for allowing me to copy paste it saved so much time!
@skitics18
@skitics18 Год назад
wait OH come on
@jdlrangerstudios
@jdlrangerstudios Год назад
@@skitics18 did u type in everything?
@MilkBotHere
@MilkBotHere Год назад
i dont like being lazy
@173sawYT
@173sawYT Год назад
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 Год назад
same problem.. have you solved?
@173sawYT
@173sawYT Год назад
@@aikious7638 yes
@aikious7638
@aikious7638 Год назад
@@173sawYT How ?
@173sawYT
@173sawYT Год назад
@@aikious7638 i made my npc r15 and it worked
@wigglywax1798
@wigglywax1798 Год назад
Bro this guy deserves more subs than he has. It's so difficult to find open source code. Thanks for the vid!
@uiypl4576
@uiypl4576 Год назад
It works for u ?
@wigglywax1798
@wigglywax1798 Год назад
yeah@@uiypl4576
@iRevz
@iRevz Год назад
Your The BEST BRO u just got a new Subscriber :>
@FlawlessPixel
@FlawlessPixel 4 месяца назад
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
@fejsalkusmic6137
@fejsalkusmic6137 5 месяцев назад
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!
@TrashDev_RBX
@TrashDev_RBX Год назад
Thank you, that helped me SO MUCH!!
@ClassicDev123
@ClassicDev123 Год назад
Holy THX DUD LOVE IT SO MUCH!!!
@ryanisber2353
@ryanisber2353 2 месяца назад
The script still works as of this video with only one minor change: 4:54 line 18 is now rayParam.FilterType = Enum.RaycastFilterType.Exclude This is due to a Roblox term change from Blacklist -> Exclude & Whitelist -> Include (prob due to political reasons... but everything remains the same otherwise)
@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
@Kaazmaz3447
@Kaazmaz3447 Год назад
TYSM UR THE BEST U DESERVE A SUB
@dev_axel
@dev_axel 6 месяцев назад
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?
@Darklordhedgehog
@Darklordhedgehog 9 месяцев назад
i got it to work but the only animation that works is the one in the video :/ (3 ‘edits’ down below 👇) edit: i have spent 5 hours of my entire life just trying to get the walk animation to change to actually dang walking and its no working CAN YOU PLEASE TELL ME A FIX IM GOING INSANE Edit 2: I found a half-fix Edit 3: I fixed it 2 days after the problem happened by making my own animation 👍
@realestfr
@realestfr 9 месяцев назад
if you check the output, it will probably say "Failed to load animation - sanitized ID: [ID] this is because in order for the animation to load, you need to own it. So sadly in order to get the animation to work, you need to make it yourself.
@Darklordhedgehog
@Darklordhedgehog 9 месяцев назад
@@realestfr funnily enough, I did that the day after, after searching up an animation tutorial to make my own crouching animation, and then made my own walk and attack soon after, thanks for trying to help, though!
@realestfr
@realestfr 9 месяцев назад
@@Darklordhedgehog Thats great that you found a fix right after. I on the other hand am way to lazy to make an animation 😂
@Darklordhedgehog
@Darklordhedgehog 9 месяцев назад
@@realestfr (it also turns out I’m really good at it 👍)
@adgurkan
@adgurkan 10 месяцев назад
Worked well but it gave me a "Indexed nil with humanoid root part error"
@DeltaPrecise
@DeltaPrecise 10 месяцев назад
tele could you make a tutorial on how to make it transform into the player after they get killed?
@MisterWolfOfficial
@MisterWolfOfficial 7 месяцев назад
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 :(
@Jis_notok
@Jis_notok 14 дней назад
you might want to name the walking animation Walk
@ricktherickrolled
@ricktherickrolled Год назад
UNDERRATED!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Thank you so much!!!!!! I will credit you
@sebalby34
@sebalby34 17 дней назад
the script at the intro of this vid would literally crash your game this is telling me that if i watch your tutorials my brain will deep fry, crash and i will go into a 15 year coma and wake up for 2 days before dying
@TeletacosRobloxTutorials
@TeletacosRobloxTutorials 17 дней назад
@@sebalby34 proceed at your own risk :O
@AbobaValerkin
@AbobaValerkin 10 месяцев назад
It is great! Thank you a lot!
@jontheartistlive2316
@jontheartistlive2316 4 месяца назад
The AI is easily cheesable. You can just walk behind it and it will freeze and stop moving.
@matteonganga3436
@matteonganga3436 27 дней назад
the goat
@r0cket596
@r0cket596 Год назад
Lets go! 🤩
@Gaazzee
@Gaazzee Год назад
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 Год назад
@@KlutchRU-vid you have to replace .Blacklist with .Exclude because .Blacklist is deprecated
@rayestrz
@rayestrz 9 месяцев назад
VERY USEFUL!
@TheAmazingRobloxDev
@TheAmazingRobloxDev Год назад
you can make a realistic horror game series
@A.KYT2125
@A.KYT2125 24 дня назад
it works but the monster attack but i dindt died why ?
@RobloxDev-ec5ow
@RobloxDev-ec5ow 7 месяцев назад
Great video! What would be a easy fix for the AI running into walls
@HeavyParaBeetle
@HeavyParaBeetle 9 месяцев назад
My monster keeps going to the same 3 points, it never goes to different ones.
@Adam-jq8dm
@Adam-jq8dm Год назад
Wow thank you so much!!!
@LEMONS-k9e
@LEMONS-k9e Год назад
"how to make a Monster Pathfinding AI" me: goes to the comments instead
@MatCantCode
@MatCantCode Год назад
do you know how to make the monster patrol when the player is hiding
@1m87cm
@1m87cm Месяц назад
try to add into the code something like if the player is in a certain area, the monster ignores him
@s_c_r_e_w_b_a_l_l
@s_c_r_e_w_b_a_l_l 7 месяцев назад
Hey for some reason my NPC is not moving do you know why?
@TheJamaAccount
@TheJamaAccount Год назад
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
@MatsuroPalette
@MatsuroPalette Год назад
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 Год назад
so the waypoints cant be in the Folder or it will break?
@TheJamaAccount
@TheJamaAccount Год назад
@@173sawYT no no the waypoints need to be in the waypoint folder
@kaderesuggan
@kaderesuggan 9 месяцев назад
is there a way so i can keep R6 dummy?
@Reviverrrr
@Reviverrrr 6 месяцев назад
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.
@MagicsMalice
@MagicsMalice Год назад
Teletacos do you add your own npc or does it come with it
@MagicsMalice
@MagicsMalice Год назад
Nvm I did it Thank you!
@gamerlayerplayer
@gamerlayerplayer Год назад
Thanks for the tutorial! BTW, is there any way you can tell me how to accelerate the monster?
@krishsamusementpark
@krishsamusementpark Год назад
to make the monster faster go to humanoid and change it's walk speed
@KSAINMOST
@KSAINMOST 10 месяцев назад
@@krishsamusementpark he meant when the monster sees the player
@krishsamusementpark
@krishsamusementpark 10 месяцев назад
@@KSAINMOST oh ok
@jester3183
@jester3183 Год назад
Everything's in order but i have a few issues. 1. The monster sometimes freezes for a spit second before attacking again 2. I added a script that spawns a dead body in place of the player who died, this ends up crashing the monster and it doesnt move or anything anymore 3. Sometimes the animations fully bug out This is otherwise a great tutorial!
@ImDoinItWell
@ImDoinItWell Год назад
You could probably just make it so the dead body doesnt have a humanoid, but then u cant animate it unless you find away around it.
@NobleKanna
@NobleKanna Год назад
Animationcontroller @@ImDoinItWell
@ImDoinItWell
@ImDoinItWell Год назад
@@NobleKannaYup!
@GalacticPotato101
@GalacticPotato101 6 месяцев назад
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
@ryanisber2353
@ryanisber2353 2 месяца назад
Enemy jumping doesn't seem to be working unless I messed up somewhere
@PlanetToSkt
@PlanetToSkt Год назад
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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gSYx6MVa9Tc.html
@hbbean925
@hbbean925 22 дня назад
hello it works but i have a problem im using this for a zombie so when i kill it,it still damages u even tho its dead
@DeltaPrecise
@DeltaPrecise Год назад
how should i add it to a model I want it to be?
@gtkiscool
@gtkiscool Год назад
Add a model and copy & the script
@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
@MrMetrivus
@MrMetrivus Год назад
It can be stuck even permanently stuck after hitting a wall.
@173sawYT
@173sawYT Год назад
did you use r6 or r15 character?
@ricktherickrolled
@ricktherickrolled Год назад
@@173sawYT what's the difference?
@noahandsceciliasadventures8726
I’m going to try this script on my own game when I get home 😲
@orientinc.
@orientinc. Год назад
Your content is underated and advance
@Npridatok
@Npridatok Год назад
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 Год назад
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
@Teth_Yuri
@Teth_Yuri 6 месяцев назад
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?
@polloscappatodicasapolloid4493
@polloscappatodicasapolloid4493 3 месяца назад
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)
@saltman8975
@saltman8975 9 месяцев назад
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
@ImDoinItWell
@ImDoinItWell Год назад
For some reason, it says member 'blacklist' is deprecated. What should I do to fix it?
@TeletacosRobloxTutorials
@TeletacosRobloxTutorials Год назад
Simply replace blacklist with Exclude
@ImDoinItWell
@ImDoinItWell Год назад
@@TeletacosRobloxTutorials Thx bro
@ImDoinItWell
@ImDoinItWell Год назад
@@TeletacosRobloxTutorials I also have a problem where he just goes to me then just stops? I have no idea why, I eddited the script and then changed it back to no avail.
@yumgumrumdumb6189
@yumgumrumdumb6189 Год назад
@@TeletacosRobloxTutorials tysm
@y3s_mast3r
@y3s_mast3r 2 месяца назад
Hey man, great tutorial. I know you posted this a long time ago but i just have an issue. Even though I set the AI to be faster than the player, it seems to slow down around 2-3 studs from the player. I believe this has to do with the attack script since it is based off distance, but i’d like to know if you had a solution. Thanks!
@bromf3
@bromf3 2 месяца назад
script work? because my script don't work, even after changing to exclude
@DreamGamingTv
@DreamGamingTv 2 месяца назад
@@bromf3Same, have you got fixed it?
@bromf3
@bromf3 2 месяца назад
@@DreamGamingTv no I still don't understand, I've already replaced it, the script is still not working, and the script developer is not active.
@StupidMiners
@StupidMiners 5 месяцев назад
I have a small problem. It doesn't attack me. It also stops when it hits me.
@SledgerPlaysYT
@SledgerPlaysYT Год назад
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
@BroxsyGamez
@BroxsyGamez Год назад
If you don't mind me asking, do you know a fix for the 'Blacklist' command as it is marked as 'deprecated'
@DustyBawls.
@DustyBawls. Год назад
Yes instead of .Blacklist put .Exclude it will work
@BroxsyGamez
@BroxsyGamez Год назад
@@DustyBawls. thx soo much, this really helps
@dannygong1596
@dannygong1596 Год назад
Gracias I appreciate it
@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
@MagicsMalice
@MagicsMalice 3 месяца назад
What if the monster is a Mesh Rig?
@inglish1274
@inglish1274 11 дней назад
Mine doesnt work either the script is wrong or something but the npc aint moving
@KSAINMOST
@KSAINMOST 10 месяцев назад
can you tell me where to place the idle animation
@jorgilininfinite8034
@jorgilininfinite8034 20 дней назад
how can i make the enemy run when he's chasing the player? i have a run anim but i don't know how to add it.
@Arthur_Guy
@Arthur_Guy 2 месяца назад
Hello! Please reply to this comment, the script works however is there a way to change the enemy’s walkspeed or something similar? Thank you and hope you reply!
@DreamGamingTv
@DreamGamingTv 2 месяца назад
local walkspeed = 50 (for example) hunanoid.WalkSpeed = walkspeed (Done)
@DarkenV1
@DarkenV1 8 месяцев назад
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?
@minecraftlolguy6869
@minecraftlolguy6869 Год назад
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 Год назад
Maybe look in the walk properties and see if there is an animation id
@TheLaggedAlertzz
@TheLaggedAlertzz Год назад
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.
@brawl4855
@brawl4855 День назад
Bro when I crouch and uncrouch I can't move anymore
@storylynnegoss1565
@storylynnegoss1565 2 месяца назад
I litterally pasted this and did exactly what it told me to do but it doesnt work >:(
@StevenBadAss
@StevenBadAss Год назад
is there a way to remove the pause when the monster is deciding where to go next?
@Pixel6588
@Pixel6588 10 месяцев назад
While task.wait() do | Line 139
@StevenBadAss
@StevenBadAss 6 месяцев назад
thanks @@Pixel6588
@movfile
@movfile Год назад
cool intro
@Jis_notok
@Jis_notok 14 дней назад
question, how can i adjust the speed of the monster?
@CookieOnGames
@CookieOnGames 5 месяцев назад
it doesnt work for me the npc just stands still.
@ChatGris-vf1iu
@ChatGris-vf1iu 4 месяца назад
same
@jontheartistlive2316
@jontheartistlive2316 4 месяца назад
Make sure HumanoidRootPart is unanchored
@lifetime9584
@lifetime9584 Год назад
Your videos are really cool and nice but you should speak louder
@vestigefish
@vestigefish Год назад
are the attack and walk animations necessary? if so, I think it's what's messing my AI up.
@ItsOfficialArano
@ItsOfficialArano Год назад
Yes
@vestigefish
@vestigefish Год назад
thanks, I've been trying to see what's been messing it up@@ItsOfficialArano
@ItsOfficialArano
@ItsOfficialArano Год назад
@@vestigefish I think i understand why it didn't work, cua on the script they said like tehy need 2 animations, and you dont have the anims qo the qcript says it doesnt exist what do i do and it mess all of your game
@vestigefish
@vestigefish Год назад
thanks for the help!@@ItsOfficialArano
@KSAINMOST
@KSAINMOST Год назад
@@ItsOfficialArano its not that to me
@BloxRolling
@BloxRolling Год назад
To make your own animations do you use animating editor
@stoneshelly7337
@stoneshelly7337 Год назад
yessir
@dakung_oflabaland3710
@dakung_oflabaland3710 5 месяцев назад
it always stops when it gets close to me. You know why?
@Blox_onix
@Blox_onix 4 месяца назад
local PathfindingService = game:GetService("PathfindingService") local npc = script.Parent local humanoid = npc:WaitForChild("Humanoid") local hrp = npc:WaitForChild("HumanoidRootPart") hrp:SetNetworkOwner(nil) local walkAnim = humanoid.Animator:LoadAnimation(script.Walk) local attackAnim = humanoid.Animator:LoadAnimation(script.Attack) local pathParams = { AgentHeight = 5, AgentRadius = 3, AgentCanJump = true, } local rayParams = RaycastParams.new() rayParams.FilterType = Enum.RaycastFilterType.Blacklist rayParams.FilterDescendantsInstances = {npc} local lastPos local animPlaying = false local RANGE = 60 local DAMAGE = 30 local function canSeeTarget(target) local orgin = hrp.Position local direction = (target.HumanoidRootPart.Position - hrp.Position).Unit * RANGE local ray = workspace:Raycast(orgin, direction, rayParams) if ray and ray.Instance then if ray.Instance:IsDescendantOf(target) then return true else return false end else return false end end local function findTarget() local players = game.Players:GetPlayers() local maxDistance = RANGE local nearestTarget for i, player in pairs(players) do if player.Character then local target = player.Character local distance = (hrp.Position - target.HumanoidRootPart.Position).Magnitude if distance < maxDistance and canSeeTarget(target) then nearestTarget = target maxDistance = distance end end end return nearestTarget end local function getPath(destination) local path = PathfindingService:CreatePath(pathParams) path:ComputeAsync(hrp.Position, destination.Position) return path end local function attack(target) local distance = (hrp.Position - target.HumanoidRootPart.Position).Magnitude local debounce = false if distance > 5 then humanoid:MoveTo(target.HumanoidRootPart.Position) else if debounce == false then debounce = true npc.Head.AttackSound:Play() attackAnim:Play() target.Humanoid.Health -= DAMAGE task.wait(0.5) debounce = false end end end local function walkTo(destination) local path = getPath(destination) if path.Status == Enum.PathStatus.Success then for i, waypoint in pairs(path:GetWaypoints()) do path.Blocked:Connect(function() path:Destroy() end) if animPlaying == false then walkAnim:Play() animPlaying = true end attackAnim:Stop() local target = findTarget() if target and target.Humanoid.Health > 0 then lastPos = target.HumanoidRootPart.Position attack(target) break else if waypoint.Action == Enum.PathWaypointAction.Jump then humanoid:ChangeState(Enum.HumanoidStateType.Jumping) end if lastPos then humanoid:MoveTo(lastPos) humanoid.MoveToFinished:Wait() lastPos = nil break else humanoid:MoveTo(waypoint.Position) humanoid.MoveToFinished:Wait() end end end else return end end local function patrol() local waypoints = workspace.Waypoints:GetChildren() local randomNum = math.random(1, #waypoints) walkTo(waypoints[randomNum]) end while task.wait(0.2) do patrol() end change the script with this
@SophieGreen-t8p
@SophieGreen-t8p Месяц назад
i copied the code but my entity wasnt moving need help
@Gond2X
@Gond2X 10 месяцев назад
What if u want to change anim to chase while he found u and return back while lost u walk..??
@krind4718
@krind4718 Год назад
Don't working.
@C-O-R-R-U-P-T-I-O-N
@C-O-R-R-U-P-T-I-O-N 11 месяцев назад
💀
@lalmalsawmachhakchhuak4114
@lalmalsawmachhakchhuak4114 8 месяцев назад
what kind of version do you have 😵‍💫😵‍💫😵‍💫
@Marcusthedawg7722
@Marcusthedawg7722 Год назад
I don't understand one thing: when did you call the function "WalkTo"
@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!??
@budimkasimic7450
@budimkasimic7450 Год назад
for me this doesn't work
Далее
How To MAKE a Pathfinding MONSTER In Roblox Studio!
25:23
Classic Roblox Games: How Are They Doing?
17:09
Просмотров 350 тыс.
How Many Twins Can You Spot?
00:17
Просмотров 23 млн
I Made a Fake Warning to Scare Roblox Players
16:31
Просмотров 1,3 млн
3 Hours vs. 3 Years of Blender
17:44
Просмотров 5 млн
Pathfinding Dummy! - Roblox Studio 2024!
8:57
How to make a PATHFINDING AI in ROBLOX STUDIO!
10:53
Просмотров 4,9 тыс.
How To Make Realistic Reflections in Roblox Studio
13:11
Making FNAF In Roblox
12:12
Просмотров 745 тыс.
AI Monster Pathfinding -Teddy Horror Game #2
16:46
Просмотров 470 тыс.
I Made a Roblox Game, but in 24 hours
27:10
Просмотров 250 тыс.