I’m doing a pathfinding script, and it takes a while to start actually moving. First two waypoints, it stays in the same position. Then it waits like 4 seconds and finishes the rest. This is the script:
local TweenService = game:GetService("TweenService")
local PathFindingService = game:GetService("PathfindingService")
local Camera = game.Workspace.CurrentCamera
local CamTweenInf = TweenInfo.new(4,Enum.EasingStyle.Quint,Enum.EasingDirection.InOut,0,true)
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local UIS = game:GetService("UserInputService")
local humanoid = player.Character:WaitForChild("Humanoid")
local walkTo = game.Workspace.NPCParts.Part
local Chat = player:WaitForChild("PlayerGui").GameChat
local path = PathFindingService:CreatePath()
path:ComputeAsync(game.Workspace.Ichigo.HumanoidRootPart.Position,walkTo.Position)
local wayPoints = path:GetWaypoints()
local TextAnimHandler = require(game.ReplicatedStorage.TextAnimation["imagine copying scripts from devforum"])
game.ReplicatedStorage.CameraTweening.TweenCamera.OnClientEvent:Connect(function(partName)
local camTween = TweenService:Create(Camera,CamTweenInf,{CFrame = game.Workspace.CameraParts[partName].CFrame})
Camera.CameraType = Enum.CameraType.Scriptable
humanoid.WalkSpeed = 0
camTween:Play()
UIS.MouseIconEnabled = false
camTween.Completed:Wait()
for i,v in pairs(wayPoints) do
game.Workspace.Ichigo.Humanoid:MoveTo(v.Position)
game.Workspace.Ichigo.Humanoid.MoveToFinished:Wait()
print("moved "..i.." to "..tostring(game.Workspace.Ichigo.HumanoidRootPart.Position))
end
Chat.Enabled = true
TextAnimHandler.typeWrite(Chat.Frame:WaitForChild("CharacterText"), "test text aa a a a")
TextAnimHandler.typeWrite(Chat.Frame.CharacterName.Label, "Ichigo:")
humanoid.WalkSpeed = 16
Camera.CFrame = game.Workspace.CameraParts[partName].CFrame
UIS.MouseIconEnabled = true
end)