So I have a script, and I'm trying to make a cool lightning body effect. I managed to get what I was looking for, but the meshes kind of dragged back when I moved, so I decided to try welding it and changing the C1 instead of just changing the meshes' CFrames.
My goal was to have the lightning meshes placed randomly around each part of the player's body all the while being welded to the parts, but changing the C1 of the welds doesn't seem to do anything. I do know the C1 is changing though, thanks to a print test, it's just not changing the position of the meshes.
Without Welds: https://gyazo.com/dcd1ce6203874895d51866620f16ff91
With Welds: https://gyazo.com/48944708dcb93c180b64d81ceb4d6394
Script:
-- Varaibles local part = script.Parent for i,v in pairs(part:GetChildren()) do if v.ClassName == "MeshPart" then local weld = Instance.new("Weld",v) weld.Name = v.Name weld.Part0 = part weld.Part1 = v end end -- Lightning Effect while wait() do local spread = (part.Size.X + part.Size.Y + part.Size.Z)/3 for i,v in pairs(part:GetChildren()) do if v.ClassName == "MeshPart" then local weld = v:FindFirstChild(v.Name) v.Transparency = 1 if weld then weld.C1 = CFrame.new(math.random(-spread,spread),math.random(-spread,spread),math.random(-spread,spread)) * CFrame.fromEulerAnglesXYZ(math.random(0-(math.pi*2),(math.pi*2)),math.random(0-(math.pi*2),(math.pi*2)),math.random(0-(math.pi*2),(math.pi*2))) end wait() v.Transparency = 0 end end end