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
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)