I am trying to make particles constantly hover up and down for about 20 seconds. I figured out that I needed to use acceleration to allow them to move up and down, but the particle goes up, then not as much down, then back up. I understand this is due to the down acceleration having to slow down the up acceleration, but I wanted to know if there is a fix. Here’s my code.
while true do
particleEmitter.Acceleration = Vector3.new(0,0,0)
particleEmitter:Emit(150)
local sign = 1
for i = 1, 10, 1 do
particleEmitter.Acceleration = Vector3.new(0,moveAmt.Value * sign,0)
sign *= -1
task.wait(2)
end
end
After looking at the video again, I think the effect I created wasn’t how you wanted.
Instead of using ParticleEmitter.Acceleration, we can just tween the part itself and use ParticleEmitter.LockedToPart = true
Here’s a video of my new attempt
local Workspace = game:GetService("Workspace")
local TweenService = game:GetService("TweenService")
local part = Workspace.Part
local particleEmitter = part.ParticleEmitter
local AMPLITUDE = 32
local DURATION = 20
local AMOUNT = 150
particleEmitter.Speed = NumberRange.new(0)
particleEmitter.Rate = 0
particleEmitter.Lifetime = NumberRange.new(20)
particleEmitter.LockedToPart = true
particleEmitter.Enabled = true
particleEmitter:Emit(AMOUNT)
local tweenInfo = TweenInfo.new(DURATION / 2, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0)
local upTween = TweenService:Create(part, tweenInfo, {Position = part.Position + Vector3.new(0, AMPLITUDE, 0)})
local downTween = TweenService:Create(part,tweenInfo, {Position = part.Position})
upTween:Play()
upTween.Completed:Wait()
downTween:Play()
downTween.Completed:Wait()
particleEmitter.Enabled = false
particleEmitter:Clear()
I’ve never needed it myself so I’m not 100% how it functions but I think it’s a simpler way of achieving the effect. It requires no scripting which is best for performance.