Need help with Knit

When I got the Knit module and inserted it into the game, this is what it looked like:
Screenshot 2022-02-19 182703

However, Idk if this is arranged correctly because when I try to reference the Util Module (It’s somewhere in the _index folder) according to the Documentation, I end up referencing Nil as there is no Util folder in the Knit module.

Could anyone explain to me what is going on?

Util is a Knit variable that points to the Util folder.

local Knit = require(Path_To_Knit)
local PACKAGE = require(Knit.Util.PACKAGE)

I managed to come to that conclusion. The root of the issue was actually that the function Auto had been removed from the Components Module in the Utilities. Do you happen to know if there is any Substitute for Component.Auto()?

Require the modules yourself. Auto is essentially the same abstraction as AddServices/Controllers – it goes through the descendants of a given folder, requires any ModuleScript instances and then creates a component from a, if one is, returned table.

If you need a reference (Auto was removed when Component v2 was released), this was the function:

function Component.Auto(parent)
	local function Setup(moduleScript)
		local m = require(moduleScript)
		assert(type(m) == "table", "Expected table for component")
		assert(type(m.Tag) == "string", "Expected .Tag property")
		Component.new(m.Tag, m, m.RenderPriority, m.RequiredComponents)
	end
	for _,v in ipairs(parent:GetDescendants()) do
		if v:IsA("ModuleScript") then
			Setup(v)
		end
	end
	return parent.DescendantAdded:Connect(function(v)
		if v:IsA("ModuleScript") then
			Setup(v)
		end
	end)
end
1 Like