Issue with :MoveTo() and animations

I don’t really know why but the animation on the Server is stuttering on the NPC
In Studio it works perfectly fine. As well as a couple days ago it worked fine everywhere else

My code:

local PhysicsService = game:GetService("PhysicsService")
local PathfindingService = game:GetService("PathfindingService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Tycoon = script.Parent.Parent.Parent
local WayPoints = Tycoon.Essentials.WayPoints

function SetNetworkOwner(Model : Model, CollisionGroup)
	for _, v in pairs(Model:GetDescendants()) do
		if v:IsA("BasePart") then
			if CollisionGroup ~= nil then
				PhysicsService:SetPartCollisionGroup(v, CollisionGroup)
			end
			v:SetNetworkOwner(nil)
		end
	end
	return
end

if Tycoon.Owner.Value ~= nil then
	if Tycoon.PurchasedObjects:FindFirstChild("Register") then
		local NPC = game:GetService("ReplicatedStorage").NPC:Clone()
		NPC.Parent = Tycoon:FindFirstChild("Essentials") and Tycoon.Essentials["NPC's"] or NPC:Destroy()

		SetNetworkOwner(NPC, "NPC")
		
		game.ServerStorage.Assets.Animate:Clone().Parent = NPC
		
		for i = 1, 35 do
			local Point = WayPoints:FindFirstChild(i)
			if Point then
				
				NPC.Humanoid:MoveTo(Point.Position)
				print(Point)

				NPC.Humanoid.MoveToFinished:Wait()
			end
		end
	end
end

App:

Studio:

This could be due to how the network ownership works. When you step away, does it become less stuttery?

1 Like

What exactly do you mean by When you step away
Also I set the NetworkOwner to the server, so this is even more why I am confused

What I meant is like, when you are far away from the NPC, does it become less jittery?

I just tried, same result. Nothing changed. I even tried another Animation Script for the NPC, also same result

Looking at it closer, it appears that it is REPEATING itself mid-way. Could you check to see if your current studio version is the same as the one you had in game?

I have prebuild the path with parts because the PathfindingService calculated a wrong way sometimes. And everytime the NPC reaches a new part position it repeats itself as you say

1 Part = 1 Stutter (I did not have this problem before)

Now I have only used 3 Parts to prevent the mass stuttering (really annoying I can’t lie)

Apologies I couldn’t provide an exact solution to your problem.

Yeah no worries, im clueless as well. I appreciate the help though!