VG3O_J
(vegetable)
August 1, 2020, 10:49pm
1
hello, when I use :Clone() in my script and put the method into a variable, the meshpart does not get parented to the model that I specified.
print("Setup started!")
for idx, child in pairs(lights.Brake:GetChildren()) do
if child.Name == "L" then
local clone = child:Clone()
clone.Parent = lights.Brake
clone.Name = "LN"
if clone:IsA("MeshPart") then
clone.TextureID = "rbxassetid://0"
end
clone.Material = Enum.Material.Neon
clone.Color = child.Color
clone.Transparency = 1
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Back
spot.Color = Color3.fromRGB(255, 0, 0)
end
end
as you see in the image, the “LN” is not visible when it should be.
1 Like
Where does the “LN” actually get parented to, or does it just not exist?
Also,
local spot = Instance.new(“SpotLight”, child)
The parent argument for Instance.new() takes longer and is slower than just having a new line and setting the parent there.
1 Like
VG3O_J
(vegetable)
August 1, 2020, 10:54pm
3
I searched through the workspace only to find that “LN” gets parented no where, it isnt found anywhere in the game. So apparently the clone doesn’t exist.
thanks for the tip with Instance.new()!
Try to add a print(“This passed”) after checking to see if the name of child is “L”. It might not be working right, and therefor not creating any clone.
focasds
(focasds)
August 1, 2020, 10:55pm
6
Is the clone a part? If so is this one Unanchored and CanCollide = false? Tell me.
VG3O_J
(vegetable)
August 1, 2020, 10:59pm
7
yes, this clone is a meshpart, but it is anchored and cancollide is false.
VG3O_J
(vegetable)
August 1, 2020, 11:00pm
8
it does print the parent and name as if it was there but it does not appear in workspace.
VG3O_J
(vegetable)
August 1, 2020, 11:01pm
9
seems like the part was falling out of the world because when it cloned, it became unanchored. fixed now!
1 Like