Folder parts missing on 'Run' click

I want my firefly parts to initialize, when clicking the Studio ‘Run’ button. However, most of the firefly parts are missing from the subfolders when I manually check them after clicking ‘Run’. :confused:

I tried some debugging, including not running the function. The thing is, these parts already exist in Workspace before clicking on the Studio ‘Run’ button, meaning I am not dynamically creating or cloning them via :Clone(), .new(), or instance.fromExisting(). :slightly_frowning_face:

Location of the subfolders: Workspace > base_parts > fireflies > ['sub_folder_name'].
The firefly parts are inside these subfolders.

The code (server script) with comments and prints :grinning_face::

local workspace_items = {
   fireflies = workspace.base_parts.fireflies -- direct indexing the fireflies folder
}


-- function to get and toggle firefly effects
local function toggle_fireflies(boo: boolean)
	for _, descendant in pairs(workspace_items.fireflies:GetDescendants()) do
		if not descendant.Parent then continue end
		
		print("descendant found:", descendant.Name) -- prints multiple times, as it shall
		
		if descendant:IsA("PointLight") then
			print("firefly light found:", descendant.Name) -- prints multiple times, as it shall
			descendant.Enabled = boo
			print("set boolean to:", boo) -- prints multiple times, as it shall
		end
	end
end

-- calling the toggle fireflies function
toggle_fireflies(false)

Is it possible that they are unanchored, falling to the destroy height, and being destroyed?

3 Likes

Unfortunately, it didn’t work. I anchored all of them with ctrl click

Are you still experiencing this issue?

1 Like

I had this issue yesterday and anchoring them solved the issue

1 Like

I don’t have a loading screen, and I think I have to add one to solve it. Do I need to though?