i actually found out how to make the AI to jump, it's actually already coded in! at the "for _, waypoint in pairs(path:GetWaypoints()) do" add this before the "NPC.Humanoid:MoveTo(waypoint.Position)" part if waypoint.Action == Enum.PathWaypointAction.Jump then NPC.Humanoid.Jump = true end edit: heres an explanation: PathWaypoints have a function added to them: Action. It can be Enum.PathWaypointAction.Jump or Walk. If it's jump, that means that the AI needs to jump to complete the next waypoint. So you can add a part that detects if that occurs, you can make the NPC jump. (no the ai cannot do wrap-arounds ;~;)
@odineli71773 ай бұрын
local pfs = game:GetService("PathfindingService") local npc = script.Parent local part = workspace:WaitForChild("Skibussy") local path = pfs:CreatePath() path:ComputeAsync(npc.HumanoidRootPart.Position, part.Position) for _, waypoint in pairs(path:GetWaypoints()) do if waypoint.Action == Enum.PathWaypointAction.Jump then npc.Humanoid.Jump = true end npc.Humanoid:MoveTo(waypoint.Position) npc.Humanoid.MoveToFinished:Wait() end 👍👍
@Gamer28591 Жыл бұрын
Dina Tutorials är grymt bra!
@TMK899 Жыл бұрын
Welcome Back King!
@CaseAB8 ай бұрын
the script: local pfs = game:GetService("PathfindingService") local NPC = script.Parent local Destination = workspace:WaitForChild("Destination") local path = pfs:CreatePath() path:ComputeAsync(NPC.Humanoid.Position,Destination.Position) for _, waypoint in pairs(path:GetWaypoints()) do NPC.Humanoid:MoveTo(waypoint.Position) NPC.Humanoid.MoveToFinished:Wait() end
@ryannoyoutube6 ай бұрын
there is a small error there, in " path:ComputeAsync(NPC.Humanoid.Position,Destination.Position) " is HumanoidRootPart, like this: path:ComputeAsync(NPC.HumanoidRootPart.Position,Destination.Position)
@erickbatista6406 Жыл бұрын
local pfs = game:GetService("PathfindingService") local NPC = script.Parent local part = workspace.Destination local path = pfs:CreatePath() path:ComputerAsync(NPC.HumanoidRootPart.Position.part.Position) for _, waypoint in pairs(path:GetWaypoints()) do NPC.Humanoid:MoveTo(waypoint.Position) NPC.Humanoid.MoveToFinished:Wait() end
@TheRealRoosterXD3 ай бұрын
The Script: local pfs = game:GetService("PathfindingService") local NPC = script.Parent local part = workspace.Destination local path = pfs:CreatePath() path:ComputeAsync(NPC.HumanoidRootPart.Position,Destination.Position,part.Position) for _, waypoint in pairs(path:GetWaypoints()) do NPC.Humanoid:MoveTo(waypoint.Position) NPC.Humanoid.MoveToFinished:Wait() end
@64126 Жыл бұрын
thank you for making me suffer from these scripts. i subscribed.
@FrozenTutorialsRoblox Жыл бұрын
You're so welcome!
@Blebo96 Жыл бұрын
could you please make a tutorial on how to make pathfinding NPC have a walking animation. Thank you
@zaydtruck3496 Жыл бұрын
make ur animation and because the NPC Wales forever u can simply make the animation play forever
@mazdnic Жыл бұрын
you can put animation script to the function where pathfinding starts
@Blebo96 Жыл бұрын
thanks@@mazdnic
@TheOfficialTHStudios Жыл бұрын
What if i want to do it like the mimic like i want him to walk and get player how can i do that please?? Also if there is a wall how can i make him go left or go right??
@5kopster3 ай бұрын
change his destination to the player's primary part position
@JanKalousWithInternetAccess Жыл бұрын
Hey frozen does the NPC have to be a rig?
@joshuadavid3975 Жыл бұрын
No it doesn’t, as long as you rig your own character correctly it will work
@Qbix1234official7 ай бұрын
Does someone know how to make the AI just stand and do nothing while not seeing the player instead of walking to waypoints? I tried so much but it doesn't work
@GiacomoAruta5 ай бұрын
Try to use 2 different bots
@brandonbombplays930418 күн бұрын
Check for the difference between the NPC's position and the player's to get the distance, and then only run the pathfinding code if it's small enough for the NPC to see you; it'll even keep going towards where it last saw you. Only problem is that it could see through solid objects, but that would just be a ton more ludicrous to code.
@ImProcrastinating0Ай бұрын
I’m just curious, what is the for loop for? I haven’t tested this script out yet but looking at it it doesn’t look like the loop is needed. Can anyone tell me why it’s there?
@КанатСагадиев-и5йАй бұрын
As i understand how computeAsync works, it computes where to "create" waypoints and then we go through waypoints by using for _ loop and move NPC to each waypoint it created.
@zombie_gamer21226 ай бұрын
It didn't work. Literally nothing works for me. >:(
@ingritE16 ай бұрын
Currently, Models containing a Humanoid instance, including typical player characters, will not be considered for path computation or path blockage, although the agent may still be blocked by those models physically. - Documentation - Roblox Creator Hub
@PixelThetwo-w1h4 ай бұрын
Because you did not learn scripting
@ingritE14 ай бұрын
@@PixelThetwo-w1h Yeah I am still learning
@wackywtp3 ай бұрын
how do i make it change the script so it follows the player continuously
@jackruffner5653 Жыл бұрын
the animation restarts everytime i reach a waypoint which screws up the animation, please make a tutorial on how to fix
@aqaisback951711 ай бұрын
make the animation set to action and make sure it is looped
@zeroforcrazyx4975 Жыл бұрын
3:45 script
@bigboy_atom Жыл бұрын
Can you fix this error GetWayPoints is not a valid member of Path "Instance"
@FrozenTutorialsRoblox Жыл бұрын
Make sure it says "GetWaypoints" and not "GetWayPoints"
@testbonne. Жыл бұрын
Hi😊
@FrozenTutorialsRoblox Жыл бұрын
hello
@cloudnthebois11 ай бұрын
it says humanoidrootpart dosent belong in workspace or something like that
@JFSTD_ Жыл бұрын
how do i weld a object to another?
@Lilleelovee Жыл бұрын
Ctrl-mouse right ( or track pad
@cloudnthebois11 ай бұрын
How to do it if it has multiple parts
@HarryLikesLambos Жыл бұрын
Where has the videos been?!
@FrozenTutorialsRoblox Жыл бұрын
Have both had lot with school and also been trying to fix a bug within the Tycoon tutorial.
@MrToastGHG Жыл бұрын
it isnt working for me what could be the problem?
@FrozenTutorialsRoblox Жыл бұрын
Make sure the npc isn't anchored
@MrToastGHG Жыл бұрын
omg i was so dumb now it works tysm@@FrozenTutorialsRoblox
@الخلبوصة6 ай бұрын
does it really work or are you offending him?
@green-s7fАй бұрын
@@الخلبوصة bro wdym💀
@الخلبوصةАй бұрын
@@green-s7f his tone of the comment makes me feel like hes offending him, and that it didnt really fix the error
@raulpaulogalura57548 ай бұрын
my rig dosent even move it just stays there WHY
@stx_17 ай бұрын
its deprecated meaning its broken and it wont get fixed
@flynnmeskus25036 ай бұрын
how do I make it follow the player?
@turkeyhater6 ай бұрын
instead of the npc following the "part" in the script, make it so the Destination is the player, or aka the "LocalPlayer" as you would write it
@woopertrooper_L Жыл бұрын
Frozen can u pls help me with a single simple script I need help with pls
@Xero_92 Жыл бұрын
cool
@Kingofkratos Жыл бұрын
How my dropper can drop a egg? pls tell me the script with auto dropper
@ProjectCryo Жыл бұрын
You have to use a meshID
@Котик-й3в9 ай бұрын
bruh why in every tutorial lm cant create ai bruhhhhh
@leonardo.76096 ай бұрын
its not ai
@BrownTroutYTOfficial8 ай бұрын
does not work
@jaykodi42625 ай бұрын
can you change it so that it follows a player instead of a part?
@TigerSnipe74 ай бұрын
just change the players name to player or humanoid i aint no professinal coder so idk how
@5kopster3 ай бұрын
I this line of code: local part = workspace.Destination change workspace.Destination to a player's primary part
@GiacomoAruta5 ай бұрын
Ik u wont answer BUT IF YOU DO, sup
@p0gg_man9658 ай бұрын
local pfs = game:GetService("PathfindingService") local NPC = script.Parent local part = workspace.destination local path = pfs:CreatePath() path:ComputeAsync(NPC.HumanoidRootPart.Position,part.Position) for _, waypoint in pairs(path:GetWaypoints()) do NPC.Humanoid:MoveTo(waypoint.Position) NPC.Humanoid.MoveToFinished:Wait() end