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 Игры
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!
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.
i really like your voice and script skills, man u deserve more!
Bro tysm, u rlly taught me rlly much in this vid
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
Thanks for this video, you r amazing ❤️
niko???? vc aqui
nico fazendo jogo pro roblox
Holy THX DUD LOVE IT SO MUCH!!!
thanks, helped me a lot
Thank you, that helped me SO MUCH!!
Lets go! 🤩
tysm ! bro helped me you are the best scripting man !
TYSM UR THE BEST U DESERVE A SUB
VERY USEFUL!
Your The BEST BRO u just got a new Subscriber :>
Thank you very much, I was struggling with this for a month. This film helped me a lot ... Greetings from Poland.
Im glad I could help
a month?? 💀 bro youre sped
@@rashy15 ?
Im from Poland
Hi = hej
great = fajne
bye = papa
good = dobrze
polish translator = polski tłumacz
My Polish translator
BRO I LOVE YOU I HAD ALWAYS PROBLEM WITH MY AI BOT BROO YOU JUST SAVED ME THANKSSSSSS
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!
Glad I could help!
you will give him million dollars ?
T----T
The best tutorial I have found so far, thank you for this vid, it's very useful
Hi im a begginer for developing thank you for this it helped me so much!
It is great! Thank you a lot!
UNDERRATED!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Thank you so much!!!!!! I will credit you
Wow thank you so much!!!
Bro this guy deserves more subs than he has. It's so difficult to find open source code. Thanks for the vid!
It works for u
?
yeah@@uiypl4576
really nice
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)
sounds interesting
I am making a child like horror game this will be amazing! TY!
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
cool intro
Your content is underated and advance
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
If your having broblems with (BlackList) in the script then change BlackList to Exclude.
thank you!
@@Darklordhedgehog your welcome
Thank you for allowing me to copy paste it saved so much time!
wait OH come on
@@skitics18 did u type in everything?
i dont like being lazy
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?
Yes to fix this error you have to set the player respawn time to less than 0.2.
@@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?
@@SrSealKing you can copy the link from description and make sure your animations and stuff are titled right
@@SrSealKing get everything done first then check if script works
😂I was laughing when that thing site and found nothing looks like that monster is sad 😂
you can make a realistic horror game series
I’m going to try this script on my own game when I get home 😲
Can you teach how to make a player be able to create the waypoints for the AI? Thanks for the tutorial.
you basically shoot poop out your arse and then flush the garden
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
Thats how you make the waypoints :)
cooool
tele could you make a tutorial on how to make it transform into the player after they get killed?
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?
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
did you add the kill sound in the head
same problem.. have you solved?
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
@@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
@@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.
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 :(
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
BRO THANK YOU SO MUCH BRO i almost forgot to get it outside of the part it came in thank god for telling me
so the waypoints cant be in the Folder or it will break?
@@173sawYT no no the waypoints need to be in the waypoint folder
is there a way so i can keep R6 dummy?
Worked well but it gave me a "Indexed nil with humanoid root part error"
Great video! What would be a easy fix for the AI running into walls
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?
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.
do you know how to make the monster patrol when the player is hiding
My monster keeps going to the same 3 points, it never goes to different ones.
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?
dude nice tutor
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)
does anyone have animation ID's for the Rthro animation pack? I can't find the locomotion ID's anywhere.
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
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
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?
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.
the humanoidrootopart must be unachored
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
same problem.. have you solved?
@@aikious7638 yes
@@173sawYT How ?
@@aikious7638 i made my npc r15 and it worked
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!??
Hey for some reason my NPC is not moving do you know why?
Teletacos do you add your own npc or does it come with it
Nvm I did it Thank you!
:O
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?
I have a small problem. It doesn't attack me. It also stops when it hits me.
bro when monster see me it come to position where i'm and then stuck and didn't give and damage
The AI is easily cheesable. You can just walk behind it and it will freeze and stop moving.
can you tell me where to place the idle animation
Unfortunately I have a Error. "Network Ownership API cannot be called on Anchored parts or parts welded to Anchored parts. - Server - AI:6"
The HumanoidRootPart is most likely anchored, make sure to unanchor it
@@TeletacosRobloxTutorials Thanks a lot, everything works!
@@TeletacosRobloxTutorials by the way, you can develop this idea, and make the monster lose sight of the player when he is in a closet
Also I tried making another one of them but the new one doesnt move idk why
Thanks for the tutorial! BTW, is there any way you can tell me how to accelerate the monster?
to make the monster faster go to humanoid and change it's walk speed
@@krishsamusementpark he meant when the monster sees the player
@@KSAINMOST oh ok
What if u want to change anim to chase while he found u and return back while lost u walk..??
I just find this for the Vision ai
To make your own animations do you use animating editor
yessir
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
idk, but it personally would just and wedges around it, to make it have the ability to climb over
How do i let the script run, if I start the game the npc does nothing at my sight.
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 .
make sure it's humanoid
and if i want to make doors but the ai script cant detect if theres a door
you can make a chase theme and a chase animation?
I tried so many Script but they dont work on mine can someone tell me what's happening. does my Roblox Studio Glitch?
There is an error at line 18 did anyone figure the error out?
Whats the error
@@BruhXD2 Its whenever you type blacklist the autofull for .blacklist is crossed out
@@KlutchRUclips you have to replace .Blacklist with .Exclude because .Blacklist is deprecated
Your videos are really cool and nice but you should speak louder
Can you teach like when player out of his location hes normal moving dont follow player?
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
Maybe look in the walk properties and see if there is an animation id
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.
This script does work, although there is an issue. The NPC wont jump.
put a block in its way and test it there
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
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
im getting this on line 34 anyone know a solution? IsDescendant0f is not a valid member of MeshPart
I don't understand one thing: when did you call the function "WalkTo"
It can be stuck even permanently stuck after hitting a wall.
did you use r6 or r15 character?
@@173sawYT what's the difference?
What if the monster is a Mesh Rig?
Hey how did u learn all of this pls tell me?
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
why does it tell me that its not right (red line under the text) in rayParams.FilterType = Enum.RaycastFilterType.Blacklist
Blacklist is changed to Exclude
If you still keep up with this video, My monster doesnt scream and is there a way to change its speed?
I don’t know about the scream but you can change the walk speed in the humanoid properties
"how to make a Monster Pathfinding AI"
me: goes to the comments instead
can you make like roblox door figure?
How do i make it like for a /spawn NPC command?
what kind of version do you have 😵💫😵💫😵💫
If you don't mind me asking, do you know a fix for the 'Blacklist' command as it is marked as 'deprecated'
Yes instead of .Blacklist put .Exclude it will work
@@DustyBawls. thx soo much, this really helps
Gracias I appreciate it
idk why it dos not work for me i allready copy the sript
what does setting network owner to nil do?
is there a way to remove the pause when the monster is deciding where to go next?
While task.wait() do | Line 139
thanks
@@Pixel6588