Hello! I have a simple problem, I have noticed that when I am trying to clone a member of a plugin folder, it only clones the instance. Why? I mean this is the example where it isn’t even a clone: (Note this code is inside a module required by the plugin script)
local assetsFolder = Plugin.Assets;
print(assetsFolder:GetChildren()) -> It actually prints all the children.
Later inside a function (inside the module) I do this:
print(assetsFolder.*child name*) -> nil
print(assetsFolder:GetChildren()) -> {}
It’s like the assets folder can’t get the children inside the function, like if the plugin script can’t get stuff inside itself.
Then later I decided that I must cite the children before the function, the thing is when I do this (inside the module):
local MainFrame = assetsFolder:WaitForChild("MainFrame")
print(MainFrame) -> prints the Instance
print(MainFrame:GetChildren()) -> prints the Instance children
inside the function:
print(assetsFolder:GetChildren()) -> {}
print(MainFrame:GetChildren()) -> {}
local cloneExample = MainFrame:Clone()
cloneExample.Parent = *a dock widget gui*
The cloneExample only is itself, it doesn’t have the children
What do I think is the issue?
Well, I think that since these functions are run in the context of the script that required the module, it can’t get the children in that module, even if the module script is in workspace.
Literally I can do workspace.plugin module.Assets.MainFrame
And there is no issue.
I need the module to be able to get its own child, and clone it. Because of context issues