I didn’t really know what category to post this in as I cannot post bug reports but MoveToFinished:Wait() waits for a few milliseconds after the humanoid moves to a waypoint. This is a really annoying issue and I would appreciate if someone made a bug report about this.
I don’t think this is an intentional bug. It should be you code issue, could you show us the code along with the vide of happening?
robloxapp-20211224-2345182.wmv (1.3 MB)
This is the pathfinding function for the script:
function pathfind(target)
local agentParams = {
["AgentHeight"] = 5,
["AgentRadius"] = 2,
["AgentCanJump"] = true,
Costs = {
Doors = 1
}
}
local path = pathfindingService:CreatePath(agentParams)
path:ComputeAsync(humanoidRootPart.Position, target.Position)
local waypoints = path:GetWaypoints()
if path.Status == Enum.PathStatus.Success then
for _, waypoint in ipairs(waypoints) do
if waypoint.Action == Enum.PathWaypointAction.Jump then
humanoid.Jump = true
end
humanoid:MoveTo(waypoint.Position)
if checkSight(target) then
repeat
wait()
humanoid:MoveTo(target.Position)
if target == nil or target.Parent.Humanoid == nil or target.Parent.Humanoid.Health < 1 or humanoid.Health < 1 then
break
end
until not checkSight(target)
break
end
humanoid.MoveToFinished:Wait()
end
else
repeat
wait()
local xRand = math.random(-5, 5)
local zRand = math.random(-5, 5)
local goal = humanoidRootPart.Position + Vector3.new(xRand, 0 ,zRand)
humanoid:MoveTo(goal)
humanoid.MoveToFinished:Wait()
break
until path.Status == Enum.PathStatus.Success
end
end
It’s not just me who encounters this issue, that’s why I think it should be a bug report