Hello, so i have this big loop on which i handle several game mechanics localy. For each mechanic i put all the part in a folder then i loop (for i,v) the folder at each frame. So i have 5 folders that i loop on this big loop. Like this :
--RunService loop
for i,v in workspace.Tour.ScriptedPart.TransPart:GetChildren() do
--Perform action
end
for i,v in workspace.Tour.ScriptedPart.Size:GetChildren() do
--Perform action
end
for i,v in workspace.Tour.ScriptedPart.Convoyeur:GetChildren() do
--Perform action
end
for i,v in workspace.Tour.ScriptedPart.MoveTP:GetChildren() do
--Perform action
end
--end)
So my question is : Do i do the good way , or should i put ALL theses part into a folder then detect which part it is then do the mechanic like this :
--RunService loop
for i,v in workspace.Tour.ScriptedPart.ALLMECHANIC:GetChildren() do
if v.Name == 'MOVEMENT' then
--Perform action
elseif v.Name == 'COLLIDE' then
--Perform action
elseif v.Name == 'TRANSPARENCY' then
--Perform action
elseif v.Name == 'LOOOL' then
--Perform action
elseif v.Name == 'COOOL' then
--Perform action
end
end
--end)
Thank you for your help and advice !