local function OnPlayerAdded(Player)
local Character = Player.CharacterAppearanceLoaded:Wait()
Character = nil
Player = nil
end
Players.PlayerAdded:Connect(OnPlayerAdded)
Is it necessary to make Player and Character nil after the code using those variables is done?
collectgarbage() is ran when there are unnecessary memory, therefore prevents memory to increase indefinitely. Woops, someone clarified to me something about it.
Unfortunately, we cannot control it. We can only read from it.
I’m pretty sure collectgarbage is just a function that developers can run to interface with the garbage collector and control or read from it, not something that’s actually ran (the garbage collector being an independent process).