Pathfinding issue

So I’m working on a baldi’s basics game on Roblox, because I am bored. and I tried to make the Principal, just wander out as a basic test, and he gets stuck on the yellow doors, The reason what confuses me is that

  1. The doors and the principal are in collision groups which ignore each other.
  2. The door contains a pathfinding modifier with Passthrough enabled.
    This happens
    Streamable
    Code snippet

local floorrayc = RaycastParams.new()
floorrayc.FilterType = Enum.RaycastFilterType.Whitelist
floorrayc.FilterDescendantsInstances = {workspace.World.FloorObjects}
function followPath(destination)
	--task.spawn(function()
	--	for t,y in pairs(script.Parent.Principal.Frames.Slap:GetChildren()) do
	--		script.Parent.Principal.fingle.Texture = script.Parent.Principal.Frames.Slap[tostring(t)].Texture
	--		task.wait(0.02)
	--	end
	--end)
	--local partt = Instance.new("Part")
	--partt.Parent = workspace
	--partt.Size = Vector3.new(4,35,4)
	--partt.Anchored = true
	--partt.Position = destination
	--partt.CanCollide = false
	--game.Debris:AddItem(partt,1.1)
	--print("hi")
	--print("test")
	local nextWaypointIndex = 0
	-- Compute the path
	local YAxis = 326.775
	local rayca = workspace:Raycast(destination,Vector3.new(0,-100,0),floorrayc)
	if rayca ~= nil then
		YAxis = rayca.Instance.Position.Y
	end
	local pos = Vector3.new(destination.X, YAxis,destination.Z)
	
	local success, errorMessage = pcall(function()
		path:ComputeAsync(Vector3.new(character.Position.X,character.Position.Y, character.Position.Z), Vector3.new(destination.X, YAxis,destination.Z))
	end)
	--print(path.Status)
	if success and path.Status == Enum.PathStatus.Success then
		-- Get the path waypoints
		--local sound=	character.Move:Clone()
		--sound.Name = "CopyMove"
		--sound.Parent = character
		--sound:Play()
		--game.Debris:AddItem(sound,2)
		waypoints = path:GetWaypoints()

		-- Detect when movement to next waypoint is complete
		Moving = true
		local HowManyPoints = 0
		task.spawn(function()
			for i,v in pairs(waypoints) do
				HowManyPoints = HowManyPoints + 1
			end
		end)
		local HowManyWaypointSpotsToMove = 1
	
		for i,v in pairs(waypoints) do
			if Target ~= nil then
			if (destination - Target.HumanoidRootPart.Position).Magnitude >= 12 then
				Moving = false
				break
			end
		end
			if nextWaypointIndex <= HowManyWaypointSpotsToMove then
				-- Increase waypoint index and move to next waypoint
				local dist
				if Target ~= nil then
					dist =(character.Position - Target.HumanoidRootPart.Position).Magnitude
				end
				nextWaypointIndex += 1
				local GoTo = waypoints[nextWaypointIndex].Position
				--if Target ~= nil then
				--if dist <= 6 then
				--	local raycast = workspace:Raycast(character.Position, CFrame.lookAt(character.Position, Target.HumanoidRootPart.Position).LookVector * 20)
				--	if raycast ~= nil then
				--		if raycast.Instance:IsDescendantOf(Target) then
				--			GoTo = Target.HumanoidRootPart.Position
				--		end
				--	end
				--	end
				--end
				if GoTo ~= nil then
					local yax =  326.775
					local rayca2 = workspace:Raycast(pos,Vector3.new(0,-100,0),floorrayc)
					if rayca2 ~= nil then
						yax = rayca.Instance.Position.Y
					end
					local pos
					if Target ~= nil then
						if (Target.HumanoidRootPart.Position - character.Position).Magnitude <= 7 then
							pos=Vector3.new(GoTo.X,yax + 2.8,GoTo.Z)
						else
							pos=Vector3.new(GoTo.X,GoTo.Y + 2.8,GoTo.Z)
						end
					else
						pos=Vector3.new(GoTo.X,GoTo.Y + 2.8,GoTo.Z)
					end
					game.TweenService:Create(character,TweenInfo.new(0.06,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0),{Position = pos}):Play()
				-- // DEBUG STUFF LOL		
			--		local part = Instance.new("Part")
			--part.Parent = script.Parent
			--part.Size = Vector3.new(0.5,0.5,0.5)
			--part.Anchored = true
			--part.CanCollide = false
			--		part.Position = waypoints[nextWaypointIndex].Position
			--		game.Debris:AddItem(part,2)
					local dist = (character.Position - pos).Magnitude
				repeat task.wait() dist = (character.Position - pos).Magnitude until dist <= 3
					--wait(0.05)
				end
			end
		end
		task.spawn(function()
			repeat task.wait()
			--	print(nextWaypointIndex)
			--	print(HowManyWaypointSpotsToMove)
			until nextWaypointIndex > HowManyWaypointSpotsToMove - 1
			Moving = false
			
		end)
end
end

Pretty sure him falling into the floor is unrelated, and I’ll fix that myself.

Made it so the door does not do anything with .CanCollide ; made them actually walk through the doors right. Still confused why it works like this but I can make it work.

Completely ruins everything that I tried to make work so I’ll try to figure something out

Did you set up any Path Parameters to match for the scale of your NPC?

local agentParams = {
	AgentRadius = 2.0,
	AgentHeight = 5.0,
	AgentCanJump = false,
}

local path = PathfindingService:CreatePath(agentParams)

I set up Radius, but not height. He works just fine if the door’s CanCollide Value never changes though. I’ll add in Height and see if anything changes.

I added in Radius and AgentCanJump = false, however there is still not a change in result.

He still believes (?) that if the door’s CanCollide Value is false he cannot walk through. Which I find super bizarre.

So he goes for the door, tries to open it, it opens and then he backtracks until the door closes and walks back and repeats it until he somehow makes it through

so I figured it out
Passthrough on PathfindModifiers basically inverts the CanCollide
True = walk through
false = Cannot
This is incredibly bad, and I do not like that this happens at all.