How To MAKE a Pathfinding MONSTER In Roblox Studio!

Поделиться
HTML-код
  • Опубликовано: 17 июл 2024
  • How To MAKE a Pathfinding MONSTER In Roblox Studio!
    FREE MODEL Pathfinding Monster: create.roblox.com/store/asset...
    🛠 This is How To MAKE a Pathfinding MONSTER In Roblox Studio! Thanks so much for watching, hope you guys have a great day! Subscribe 😎🛠
    🕸️Website: rustysillyband.com/
    😎Subscribe: www.youtube.com/@rustysillyba...
    💬Discord: / discord
    🌴Roblox Group: www.roblox.com/groups/1729640...
    👑Rusty Merch: www.roblox.com/groups/1729640...
    ⌚Timed Chapters:
    0:00 Intro
    0:40 Waypoints
    1:40 Pathfinding Script
    17:45 Testing
    19:42 Animations
    24:50 Outro
    📝Tags:
    #roblox #robloxstudio #gamedevelopment #robloxstudioscripting #robloxstudiotutorial #lua #robloxhorror #robloxhorrorgames
    ❓What is Roblox Studio?
    🔎Roblox Studio lets you create anything and release with one click to smartphones, tablets, desktops, consoles, and virtual reality devices.
    ❓Who am I?
    🔎I am a Roblox Studio Tutorial RUclipsr that you should Subscribe to :)
  • ХоббиХобби

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

  • @uz969
    @uz969 Месяц назад +2

    thank you rustysillyband, this works really well and i couldn't have done this without your video

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

    Was thinking about it, thank you!

  • @Goobie-plays
    @Goobie-plays 4 месяца назад +2

    TYSM THIS HELPED ME ALOT!!!!😆

  • @WallBlossum
    @WallBlossum Месяц назад +5

    Can you start putting the code in your descriptions so we can copy and paste

  • @raygupRBLX
    @raygupRBLX 29 дней назад +1

    Great tutorial! you are one of those devs that actually explain things unlike the scam devs that make you script for like 500 hours and then nothing works; New subscriber great channel. Like personally I'm a small roblox dev but these tutorials are very good.

  • @ChatGris-vf1iu
    @ChatGris-vf1iu 2 месяца назад +1

    This helped me a LOT
    The monster chases the player perfectly!
    But for some reason ( idk why) it can't follow the waypoints.. It doesn't even do the first one.
    But overall, It's perfect!
    I'm going to find how to make the pathfinding work.

  • @user-vk5ev4qj9e
    @user-vk5ev4qj9e 4 месяца назад +1

    W VID MPAN KEEP MAKING THOSE VIDS

  • @user-im4yx4oh1s
    @user-im4yx4oh1s 3 месяца назад +1

    Ty for the tutorial!

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

    love the effort!

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

    as always good job

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

    From the BOTTOM of my heart, I LOVE YOU. I have searched for tutorials for a WHILE and none of them worked, but this worked. You don't know how much I genuienly love you bro. Really helpful that you explained this since I have a little bit of coding experience and therefore I made changes that suited my game, thanks for that too

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

      Thank you for your encouraging words! They mean a lot to me. I appreciate you taking the time to write this message and I hope the best for you in all future endeavors. Thanks again, have an amazing day!

    • @raygupRBLX
      @raygupRBLX 29 дней назад +1

      I agree!

    • @Unc1e_Jeff
      @Unc1e_Jeff 19 дней назад

      @@rustysillyband can add the script somewhere to copy

  • @TheOneWhoWearsAHat
    @TheOneWhoWearsAHat 13 дней назад

    this actully works, thank you

  • @therandomapple7543
    @therandomapple7543 19 дней назад +1

    This is a great tutorial!

  • @Cautiye
    @Cautiye 24 дня назад

    thanks for the tutorial, this was actually my first long script that actually worked, just one thing, my monster commonly gets stuck on walls after a couple of patrols, as he picks a waypoint on the other side of the map, is there a way to fix that?

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

    Great vid! Im currentlt working on a smart AI which will chase the player until it can't see them anymore. If it can't see the player, it will continue in the direction the player went to try and gaun sight of them again. I'm having a lot of issue with the code but It's almost done I can feel it

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

    hey man! so i do have a few problems
    1. even if the AI is faster then you, it will stop in little tiny intervals, causing it to not kill you even if you cant outrun it via walkspeed difference
    2. i have barriers placed around the map, and if i am on the other side of the barrier the AI is, it will just walk to some other waypoint instead of continuing to chase me/going around the wall, i think this is generally because of how raycasting works

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

    well it works, but it didn't go to the part it goes to the other Rig Model and if i delete the other rig model, the rig doesn't move

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

    Wait… what if I just tied a part from the waypoints to the player, make it invisible so there isn’t just a cube on top of the player, tie a part to the monster that does damage, and just make the monster go for the waypoint?
    (Btw I haven’t tried using this yet but I will next week so im not saying that it doesn’t work.)

  • @Hello-ks6xd
    @Hello-ks6xd Месяц назад

    Finally a video not 4 years old 🙏😭
    The script works well but my attack animation does not stop it continues without switching to the walk animation
    I would like to know how to fix it even tho it's not a big deal I can just do a jumpsare scene instead

  • @user-py9im7gz5q
    @user-py9im7gz5q 4 дня назад

    For some reason the monster in my game just slides across the map and it doesn't go towards any of the waypoints and it doesn't chase or kill the player

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

    w tutorial, love it

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

    THE ONLY WORKING PATHFINDING I FOUND AND IT WAS EXPLAINED AMAZINGLY THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU
    (If you couldn't tell I'm quite thankfull for this)

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

    can you please make another video about fixing the bug on your model? When the waypoints are behind a wall he just hugs the wall instead of going around it...

  • @burby2413
    @burby2413 8 дней назад

    OMG FINALLY A TUTORIAL THAT WORKS I CANNOT EXPLAIN HOW GRATEFUL I AM!!!!!

  • @user-kk2iv2lz3q
    @user-kk2iv2lz3q 3 месяца назад

    Heyy Rusty! Its me again. I was working on my horror game with very little knowledge and I ran into an issue. I was wondering how to adjust the FirstPerson Script you made in your other video to make it where when GUI is visible it is unlocked, so that you can move your mouse around. Please let me know how to fix this!!

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

      Hi there! You can simply create a screenGui with a textButton inside of it. After that, simply set the size of the textButton to (0,0,0,0) and tick the Modal property to true. This will allow you to move your mouse around in first person. Thanks for watching, have an amazing day!

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

    When the Monster is chasing me, it’s moving but it’s stopping every second now can you fix this?

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

    Thx man i was working at my game with my friend , i can not make this .

  • @luigifernando_
    @luigifernando_ 6 дней назад

    i did everything in the script but the npc doesn't follow the player, just goes to waypoints
    i tried using your model and that doesn't follow the player either

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

    This is so helpful! Thanks!

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

      Thanks for watching, have a blessed day!

  • @GGeneralQuest
    @GGeneralQuest 7 дней назад

    rustysillyband i tried working it out but when i try the local functions wont get called why?
    please help

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

    Can you please make a tutorial that’s pretty much opposite to this? One about a little creature that runs around randomly, and when a player gets close it runs away unless the player is crouched? Then if the player is crouched they can sneak up to it and pet it

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

      Interesting idea! Thanks for watching!

  • @leps6658
    @leps6658 6 дней назад

    What if i used a mesh with a humanoid root part? Is that works?

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

    I'm having a slight issue, the monster is not chasing the player, is it because I have a custom player model for the game? It could also be because my monster is large, idk
    Edit: found the issue, the problem is that I can't fix it, the reason why it isnt working is because its root part is higher than the player meaning it doesn't see the player, my problem is that I can't make my monsters legs smaller, is there any other fix?

    • @rustysillyband
      @rustysillyband  2 месяца назад +1

      You can try to increase the distance that it is able to attack from. Instead of doing 5, you can do 10. Other than that, you can move the RootPart down closer to his legs, but you will also have to edit the HipHeight in the Humanoid.
      Thanks for watching, have an amazing day!

    • @DragonKingGaming0
      @DragonKingGaming0 2 месяца назад +1

      @@rustysillyband thank you so much, I'll try what I can do

    • @DragonKingGaming0
      @DragonKingGaming0 2 месяца назад +1

      ​@@rustysillybandI resulted in using a different model (just an r6 block model) and the game the monster is for is like a backrooms type game, the problem is that it refuses to walk if placed on a part or if the way points are behind a wall (it's able to go around the wall it just won't)

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

    when i add the rig it doesn't move. How can i fix this?

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

    how can you reset the position of the monster after you die???

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

    Mine is not moving when I play it but is moving while I run it
    Any help?

  • @AngeloFuenteslara
    @AngeloFuenteslara 14 дней назад

    It helped me out a lot but it took almost 2 hours

  • @TunverTulvis
    @TunverTulvis Месяц назад +2

    my rig doesnt do anything. It doesnt move, it doesnt attack or anything. why is that?

    • @LilFellas123
      @LilFellas123 20 дней назад

      Did you unanchored every part of the model?

  • @twgusta1
    @twgusta1 3 дня назад +1

    I love you❤

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

    Hey I didn’t see the parts in the waypoints folder

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

    nice

  • @foxyfriend45
    @foxyfriend45 15 дней назад

    If there is anyone who is making a single-player horror game (like me) and already has the jump scared added (it's one of his other videos)
    And is rather annoyed about the walking animation needing to be shorter, or your NPC having a reaction of a brick. There is a simple solution,
    make a separate script, put a folder into the script and name it "Animations", put an Animation in the folder and name the animation "Walk", and put your ID into the animation. Put the following into the script;
    " local rig = script.Parent
    local animations = script.Animations
    local walkAnimation = rig.Humanoid.Animator:LoadAnimation(animations.Walk)
    walkAnimation:Play()"
    The jumpscare will still play as normally, your NPC walking animation can be longer than the patrol and won't break, you can have an attack animation but the player won't see it (most likely)

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

    how do i add an idle anim to it

  • @user-kk2iv2lz3q
    @user-kk2iv2lz3q 4 месяца назад +1

    Is this series going to be a horror game like the asylum? or something else. If something else, please inform me on it

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

      Hi there! This series is simply covering every popular horror game mechanic so that you can create any horror game you would like. A few mechanics include:
      - Flashlight
      - Monsters
      - Jump scares
      - Objectives
      - Story
      - etc..
      Thank you for watching, have an amazing day!

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

      @@rustysillyband Hey i have a problem. What if our model doesnt have Humanoidrootpart because we made it ourselves in blender?

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

    my monster doesen't walk what should i do?

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

    HOW DO I CUSTOM THE MONTERS?

  • @vvg907
    @vvg907 Месяц назад +1

    ( i learning english, so sorry anything 😅) I've been looking at pathfinding for a long time and every script I went through I found an error in the output:
    Stack Begin - Studio
    21:57:26.952 Script 'Workspace.HorrorMonster.PathfindingScript', Line 108 - function patrol - Studio - PathfindingScript:108
    21:57:26.953 Script 'Workspace.HorrorMonster.PathfindingScript', Line 117 - Studio - PathfindingScript:117
    21:57:26.953 Stack End - Studio
    Do you know how I can solve this?

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

      and yes… i created a folder with parts and rename for Waypoints

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

      I found this error, basically i not achored the waypoints, lol

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

    i have a cool video idea : make it where the monster can't find someone if they are touching a specific part or hiding spot

  • @Cxrulean
    @Cxrulean 28 дней назад

    It wont chase the player :(
    Just follows the way points and moves sporadically

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

    Hey I did every thing correct but it didn’t work I really need a monster for my game

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

    why my rig is not working? pls answer asap

  • @porta1master096
    @porta1master096 29 дней назад

    I have one question. who's better at pathfinding?
    Rusty or gnomecode

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

    bro i upload the code from your free model to another fresh rig unchanged and he gives up while walking to one and goes to a different one an repeats

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

      Hi there! Did you make sure to create your animations for the rig?

  • @MadReis10
    @MadReis10 27 дней назад

    It’s a good video works well but may you next time write the script in description because I hate writing

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

    Ty for making tutorial on comments

  • @BestSweden
    @BestSweden Месяц назад +1

    I found this video... OMG!!!

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

    I keep having line 62 of code not work? It says " HumanoidRootPart is not a valid member of Folder "Workspace.Waypoints"" do you know how to fix this?

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

    is there a way to make the speed of the monster faster? great vid btw

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

      Yes there is! Try changing the walkspeed property inside of the humanoid that's inside of your monster. Thanks for watching, have an amazing day!

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

      Thanks man

  • @AnakinSkywalker.Vader.
    @AnakinSkywalker.Vader. Месяц назад

    print("Thank you you're a G")

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

    Mine isnt doing anything

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

    can yo add the script in comments pls cuz my script wont work for some reason

  • @SFI1111
    @SFI1111 4 дня назад

    for some reasons i have orange errors-

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

    👍🏼

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

    Script if you're too lazy to type it (not organized like in the vid):
    local Players = game:GetService("Players")
    local PathfindingService = game:GetService("PathfindingService")
    local rig = script.Parent
    local function checkForCharacter(character)
    local rayOrigin = rig:FindFirstChild("HumanoidRootPart").Position
    local rayDirection = (character.HumanoidRootPart.Position - rayOrigin).Unit * 40

    local raycastResult = workspace:Raycast(rayOrigin, rayDirection, RaycastParams.new())

    if raycastResult then
    local raycastInstance = raycastResult.Instance
    if raycastInstance:IsDescendantOf(character) then
    return true
    end
    else
    return false
    end
    end
    local function findNearestPlayer()
    local players = Players:GetPlayers()
    local nearestPlayer = nil
    local maxDistance = 40
    for _, player in pairs(players) do
    if player.Character = nil then
    local targetCharacter = player.Character
    local distance = (rig.HumanoidRootPart.Position - targetCharacter.HumanoidRootPart.Position).Magnitude

    if distance < maxDistance and checkForCharacter(targetCharacter) then
    nearestPlayer = targetCharacter
    maxDistance = distance
    end
    end
    end
    return nearestPlayer
    end
    local function attack(character)
    local distance = (rig.HumanoidRootPart.Position - character.HumanoidRootPart.Position).Magnitude

    if distance > 5 then
    rig.Humanoid:MoveTo(character.HumanoidRootPart.Position)
    else
    character.Humanoid.Health = 0
    end
    end
    local function calculatePath(destination)
    local agentParams = {
    ["AgentHeight"] = 5.5
    ["AgentRadius"] = 4,
    ["AgentCanJump"] - false
    }

    local path - PathfindingService:CreatePath(agentParams)
    path:ComputeAsync(rig.HumanoidRootPart.Position, destination)
    return path
    end
    local function walkToDestination(destination)
    local path - calculatePath(destination)

    if path.Status == Enum.PathStatus.Success then
    for _, waypoint in pairs(path:GetWayPoints()) do
    local nearestPlayer = findNearestPlayer()
    if nearestPlayer then
    attack(nearestPlayer)
    break
    else
    rig.Humanoid.MoveTo(waypoint.Position)
    rig.Humanoid.MoveToFinished:Wait()

    end
    end
    else
    rig.Humanoid:MoveTo(destination - (rig.HumanoidRootPart.CFrame.LookVector * 10))

    end
    end
    local function patrol()
    local waypoints = workspace.Waypoints:GetChildren()
    local randomNumber = math.random(1, #waypoints)

    walkToDestination(waypoints[randomNumber].Position)
    end
    while task.wait(0.3) do
    patrol()
    end

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

    hi bro idk if ur going to read this but pls make me a horror looking thing in that game and send the link of body parts pls im sub

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

      Hi there! You can find the free model of the monster I used in the description of the video. Thank you so much for watching, have a blessed day!

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

    nvm the free model does the same so its a problem with his code

  • @ArchArch1718
    @ArchArch1718 24 дня назад

    Its not moving for me. I already rigged it and unanchored all of it but it still isnt moving

  • @Somber-gv5ft
    @Somber-gv5ft Месяц назад +4

    The code doesn't work I tried to check for Errors and it looks the same as yours but the rig just stands there

    • @BrodyPlayzz
      @BrodyPlayzz 18 дней назад +1

      Does it have a humanoid, a humanoidrootpart? Is it anchored?

    • @AngeloFuenteslara
      @AngeloFuenteslara 14 дней назад

      Bro is just a hater

    • @LbmrichOfficial
      @LbmrichOfficial 14 дней назад +2

      @@AngeloFuenteslarabro just cause it has an error does not mean he’s a hater 😭

    • @StBacon2
      @StBacon2 9 дней назад +1

      Oh i forgot to anchor the humanoidrootpart

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

    yo plz put the script in da discripsion

  • @user-vk5ev4qj9e
    @user-vk5ev4qj9e 4 месяца назад +1

    how do you makea jumpscare??

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

      We will be covering that soon! Thank you for watching, have an amazing day!

    • @user-vk5ev4qj9e
      @user-vk5ev4qj9e 4 месяца назад

      @@rustysillyband thnxx

  • @SM-lk2nw
    @SM-lk2nw 3 месяца назад

    Do you know bandi

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

    Can you write down the script for me please I keep misplaying things

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

      Please bro I really want to make a horror game and I have been stuck on this for about 2 weeks and I can't code and I keep mixing up all of the code please it would mean the world to me

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

      Hi there! You can find the model with the script inside of it inside of the description. Thanks for watching, have a great day!

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

      @@rustysillyband oh ok thank you so much

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

    I’m creepy panda but Ty but I don’t like path finding

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

    I cant die cause of the mosnster

  • @sumitrawat9931
    @sumitrawat9931 3 месяца назад +7

    it is not moving

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

      Is it anchored? If yes unachor it

    • @urfav_lilyxx
      @urfav_lilyxx 2 месяца назад +1

      @@skorpion090if I unanchor it then it falls apart

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

      Make sure it has an animation and unanchored

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

      Little late here
      If you're unanchoring it and it falls apart, it's because it doesn't have any motor6ds. Likely your model isn't properly rigged

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

      @@Flairex is there a way to get proper rigs ?

  • @layeproductions
    @layeproductions Месяц назад +1

    7:17

  • @MrTimbit.
    @MrTimbit. 13 дней назад

    1:32

  • @SM-lk2nw
    @SM-lk2nw 3 месяца назад

    I know both

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

    How to make monster faster

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

      You can change the WalkSpeed property inside of the Humanoid. Thanks for watching, have an amazing day!

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

      @@rustysillyband hey the Jumpscare script and pathfinding didnt work together well

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

    lol

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

    for me 13:12

  • @user-vg5tn2oe5w
    @user-vg5tn2oe5w 4 месяца назад

    how do i change the model?

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

      You can create any rig that you would like to and this script should work for it. As long as it has a Head and a HumanoidRootPart. Thank you for watching, have an amazing day!

    • @user-vg5tn2oe5w
      @user-vg5tn2oe5w 4 месяца назад

      @@rustysillyband i tried to download it and it just doesn’t show up

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

      @@user-vg5tn2oe5w It should be inside of your toolbox underneath your inventory of models.

    • @user-vg5tn2oe5w
      @user-vg5tn2oe5w 4 месяца назад

      @@rustysillyband uh i found out my website acc and my studio acc were different i fixed it