Server-side object isn’t stored anywhere internally and gets gc’ed when there’s no strong references holding to it
1 Like
In clientProxy, it looks like the assert check is the wrong way around.
function mt.__index(_self, index)
if reservedFunctions[index] then
return reservedFunctions[index]
end
local foundMethod = constructor[index]
logger.assert(foundMethod ~= nil, `Effect is missing method "{index}" to call!`)
logger.assert(effect.IsDestroyed, `Cannot :{index}() after effect has been destroyed.`)
return foundMethod
end
Since assert only errors if the conditional is false or nil, aand since you are checking effect.IsDestroyed
, it will always be error before OnDestroy is called.
Also, why not effect[index]
instead of constructor[index]
?