How do i get the instance of a path label?

I dont know how to get the instance of a path label.
I have a door and inside i placed pathfinding Modifier and set its label ro “Door” but my script doesnt work. sometimes it prints nil other times it doenst print at all

local function Move(pos: Vector3)
	path:ComputeAsync(Character.HumanoidRootPart.Position,pos)
	if path.Status ~= Enum.PathStatus.NoPath then
		local points = path:GetWaypoints()
		if points and points[3] then
			if path:GetWaypoints()[3].Label == "Door" then
				print(path:GetWaypoints()[3].Label.Instance) -- prints nil
				
			end
			Character.Humanoid:MoveTo(points[3].Position)
			--Character.Humanoid.MoveToFinished:Wait()
			--v.Humanoid.MoveToFinished:Wait()
		end
	end
end

I don’t know much on pathfinding, but I don’t think you can get an instance from modifiers. What are you trying to achieve with your pathfinding?

Oh so label is useless i guess

While I don’t think getting the part from a pathfinding modifier is possible, you can create some sort of hitbox, that if the character walked into it, it would trigger the specified door to open.

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