Pathfinding failing (Asked by a friend to do this)

My friend is making a fnaf game and hes having some problems with pathfinding
Video he sent


the character cant go for 4th waypoint
pathfinding code


function Pathfinding(To)
	local Pathfind = pathfindingService:CreatePath({AgentRadius = 5,AgentHeight = 2,AgentCanJump = false,})
	Pathfind:ComputeAsync(body.Position, To)
	local waypoints = Pathfind:GetWaypoints()
	if Debug.Value == true then
		print(waypoints)
		for i,v in pairs(waypoints) do
			local Sphere = Instance.new("Part",workspace)
			Sphere.Size = Vector3.new(.6,.6,.6)
			Sphere.Anchored = true
			Sphere.CanCollide = false
			Sphere.Material = Enum.Material.Neon
			Sphere.Shape = Enum.PartType.Ball
			Sphere.Position = v.Position
			game.TweenService:Create(Sphere,TweenInfo.new(7,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{Size = Vector3.new(0,0,0)}):Play()
			game.Debris:AddItem(Sphere,7)
		end
	end
	for k, waypoint in pairs(waypoints) do
		humanoid:MoveTo(waypoint.Position)
		if waypoint.Action == Enum.PathWaypointAction.Jump then
			humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
		end
		humanoid.MoveToFinished:Wait()
	end
	Moving = false
end
1 Like

ohhh well…
gotta go nother post to make

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.