Why is knit addcontrollers not working?

Hey,

I went back to using the knit framework because of how much I liked it. I’ve used it previously but I forgot how to work it and I keep getting this error.

I went back to one of the games I made that uses knit and added the client script inside StarterPlayerScripts. But now its erroring for some reason.

Here’s the script:

local Knit = require(game:GetService("ReplicatedStorage").Packages.Knit)

Knit.AddControllers(script.Parent.Controllers)

Knit.Start():andThen(print("Knit started: Client"))

Output:

 06:10:48.710  Knit started: Server  -  Server - Server:5
  06:10:55.296  Controllers is not a valid member of PlayerScripts "Players.Remingling.PlayerScripts"

Screen Shot 2023-08-09 at 6.14.16 AM

Anything in StarterPlayerScripts gets replicated into PlayerScripts. The error indicates Controllers hasn’t been copied yet by the time Client runs. Try adding a :WaitForChild().

2 Likes

The more you learn… thanks for the solution!

1 Like

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