So i’m working with npc’s right now but i’m running into a problem which is that the npc isn’t walking smoothly. So I wondered if there is a way to make them move smoothly.
local pfs = game:GetService("PathfindingService")
local human = script.Parent:WaitForChild("Humanoid")
local torso = script.Parent:WaitForChild("HumanoidRootPart")
local path = pfs:CreatePath()
path:ComputeAsync(torso.Position, game.Workspace.AIParts.HouseSet.Destination.PrimaryPart.Position)
local waypoints
waypoints = path:GetWaypoints()
for i, waypoint in pairs(waypoints) do
human:MoveTo(waypoint.Position)
human.MoveToFinished:Wait(2)
end
human:MoveTo(game.Workspace.AIParts.HouseSet.Destination.PrimaryPart.Position)
for i,v in ipairs(npc:GetDescendants()) do
if v:IsA("BasePart") then
v:SetNetworkOwner(nil)
end
end
SetNetworkOwner(nil) will make it so no player can have network ownership of the instance which will stop it from being “unsmooth” when two players constantly walk near an npc causing it to warp and visually teleport.
You are using :Wait(2) which means it will only check for MoveToFinished every 2 seconds which is probably your problem. Changing this to :Wait() should fix that.
What? I’m confused. In the video you’ve sent it’s working as you’ve intended. What are you trying to achieve? If you want it to move robotically you should have pre-placed nodepoints
As i mentioned in previous post if you want them to move “elegantly” you should have preset node points or mess around with the new path finding features to make the npc always walk central or not directly next to the wall, i can’t provide more help because you aren’t giving me a visual representation of what you want to achieve, the gif shown works as intended
As you can see in the vid the npc doesn’t rotates smoothly around the wall. Which I need for my project which is a movie. Now I used animations for the walk but that doesn’t fix it it only makes the npc look like its walking which it is…