In one of my games I’m trying to make a background for the title screen. It would be particles flying by, but I also have a main menu theme which I want it to adjust the speed of the particles moving which I have accomplished. The issue is that it isn’t updating the currently alive particles and waits until a new particle spawns in to update to the new speed which ruins the entire effect. as you can see here is a screenshot of the background (smaller particles are the one flying by) and heres the code I made.
local RS = game:GetService("RunService")
local maintheme = game:GetService("SoundService"):WaitForChild("Sound")
local flameEffect = script.Parent.BurningPart
local function updateFlameSpeed ()
local S = maintheme.PlaybackLoudness / 50
flameEffect.Speed = NumberRange.new(S,S)
end
RS.Heartbeat:Connect(updateFlameSpeed)