I want my script to move the character by using :MoveTo so I can later on add an animation to it. I’ve never used PathFindingService…
The character isn’t anchored and here is my script:
local Storage = game.ServerStorage
local Character = Storage:FindFirstChild(Char):Clone()
Character.Parent = workspace
local Humanoid = Character:FindFirstChild("Humanoid")
local PathfindingService = game:GetService("PathfindingService")
local path = PathfindingService:CreatePath()
path:ComputeAsync(Character.HumanoidRootPart.Position, workspace.GoalPart.Position)
local waypoints = path:GetWaypoints()
for _, waypoint in pairs(waypoints) do
Humanoid:MoveTo(waypoint.Position)
Humanoid.MoveToFinished:Wait()
end