Hey,
I’m trying to make a lightning effect with beams and attachments but the beams or attachments don’t move despite the output saying so.
The hierarchy (the attachments named AttachmentMain are the first and last at the top and bottom)
Video demonstration
The script (part of a larger one):
coroutine.wrap(function()
for i = 1, 3 do
for i, v in pairs(cloud:GetChildren()) do
if v:IsA("Attachment") and v.Name ~= "AttachmentMain" then
print(v.Position)
v.WorldCFrame *= CFrame.new(math.random(-5,5), 0, math.random(-5,5))
print(v.Position)
end
end
wait(.1)
end
for i, v in pairs(cloud:GetChildren()) do
if v:IsA("Beam") then
v:Destroy()
end
end
end)()
I’m absolutely stumped as I tried CFrame
, WorldCFrame
, Position
and WorldPosition
and can’t think of any other solutions.
Tell me if you need to see more of the script.
Thanks!