Issue:
When I’m in Studio, the NPC moves smoothly with no issues. In Roblox the NPC starts and stops constantly giving a stutter effect.
What I think:
It might be .Running event firing with 0 value for every waypoint reached, but I’m unsure how I’d get around it, if that is the case.
I use this simple walking script with Humanoid.Running:
local isWalking = false
Humanoid.Running:Connect(function(speed)
if speed > 0 and not isWalking then
StopAnimations()
isWalking = true
Walk:Play()
elseif speed == 0 and isWalking then
isWalking = false
Walk:Stop()
end
end)
And this is the pathfinding script: (Not all but just the necessary part)
for i,v in pairs(Path:GetWaypoints()) do
Humanoid:MoveTo(v.Position)
Humanoid.MoveToFinished:Wait()
end
Note: I have set all NPC BaseParts networkownership to nil.