Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Particle system, particles are not moving. Help?

Asked by 10 years ago
--Particle--
grav_force = 1
local Top = script.Parent.Ground.AbsolutePosition
local mouse = game.Players.LocalPlayer:GetMouse()
local button = script.Parent.TextButton
local l = Instance.new("Frame")
l.Size = UDim2.new(0.001, 3,0.001,3)
l.Name = "Particle"

button.MouseButton1Click:connect(function()
    l:clone().Parent = script.Parent
    l.Position = UDim2.new(0, mouse.X, 0, mouse.Y)
end)

for _, v in pairs(script.Parent:GetChildren()) do   
if v.Name == "Particle" then
    repeat
        v.Position = v.Position - UDim2.new(0, 0, 0, grav_force)
wait(0.05)  
    until
v.Position == Top.Y
end
end

When I click, the particle appears, but doesn't move. There is no errors. What I want to happen is the particle to fall slowly until it touches the edge of the ground (Top.Y)

Answer this question