Custom non humanoid, server part moving too fast for the actual npc model

Hello, I am working on a custom non humanoid character but a issue is that the server part moves too fast for the actual character to follow

here’s a vidoe, how should I calculate this?

as you see the npc model is a little far behide then the server part

and here’s the code, the task.wait() is the speed of how fast the server part is moving

	local function coroutineFunc()
		for i, waypoint in waypoints do
			local lookDirection = (aiModelRoot.Position - waypoint.Position).Unit
			local newCFrame = CFrame.lookAt(aiModelRoot.Position, waypoint.Position + lookDirection)

			aiModelRoot.CFrame = newCFrame
			aiModelRoot.Position = waypoint.Position + Vector3.new(0, aiModelRoot.Size.Y / 2, 0)
			
			local distance = (aiModelRoot.Position - waypoint.Position).Magnitude
			
			task.wait(distance / self.WalkSpeed)
			self.ReadyForUpdate = true
			break
		end
	end

I’m deviding it by the distance and walkspeed but that really only works with tweenservice

I think instead of moving the server cube every task.wait(), try waiting for the NPC to reach the cube before sending it somewhere else. Perhaps consider multiple server parts, like checkpoints, then removing them when the character gets to them. Kinda like a path.

This way, even if the character is slower it’ll “remember” where it needs to go and won’t phase through walls, etc

Well I don’t think I can do that cause the npc characters are created on the client only, I need some math that will slow the server parts down based on the npc’s walkspeed and using task.wait()