Hello,
My pathfinding module works correctly with smaller rigs, but when it’s used with a bigger one, it starts spinning hard when he is reaching the waypoint position.
I’m getting my path throught the regular method, and then doing a loop with movetofinished:Wait() before going to the next pos.
Any idea on what could be the origin of this uncontrollable spinning ?
-
roblox recording :
(https://gyazo.com/a7418558dfdfd928e6cf79dd0f644381) -
code :
...
function Move:CreatePath(Start, End)
local Path = PathfindingService:CreatePath()
Path:ComputeAsync(Start, End)
return Path
end
...
local Path = self:CreatePath(Character.PrimaryPart.Position, Part.Position)
local waypoints = Path:GetWaypoints()
self.waypointFolder = Instance.new("Folder")
self.waypointFolder.Parent = workspace
local Points = {}
for Step, waypoint in ipairs(waypoints) do
local part = Instance.new("Part")
part.Shape = "Ball"
part.Material = "Neon"
part.Material = "Neon"
part.Size = Vector3.new(1,1,1)
part.Position = waypoint.Position
part.Anchored = true
part.CanCollide = false
part.Parent = self.waypointFolder
Points[Step] = {
Part = part;
Position = part.Position;
}
end
for _, waypoint in pairs(Points) do
self.Humanoid:MoveTo(waypoint.Position)
self.Humanoid.MoveToFinished:Wait()
waypoint.Part:Destroy()
end
...
- rig Size :
YSize = 28
HipHeight = 10
Thx for reading