Tweening Particle Speeds

I’m trying to change the speed of this particle emitters’ particles like a water hose effect (takes a little to get to full power), however I’m trying to make it go with 2 numbers (like Speed = UDim.new(10, 100) to make it drop down too. however, it’s not really working. Is there a way I can fix this? if so, can you show me how?

Many Regards,
Herbertoes

Code:

local ts = game:GetService("TweenService")

local Pumping = game:GetService("Workspace").Pump.Pumping
local ValveOpen = script.Parent.ValveOpen
local nozzle = script.Parent.NozzlePart

local tweenOnInfo = TweenInfo.new(
	5,
	Enum.EasingStyle.Quint,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)

local tweenOffInfo = TweenInfo.new(
	2,
	Enum.EasingStyle.Quint,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)

local StraightOnTweenGoals = {
	Speed = UDim.new(75, 120),
	SpreadAngle = UDim.new(0.5, 0.5)
}

local StraightOffTweenGoals = {
	Speed = UDim.new(10,20),
	SpreadAngle = UDim.new(10, 10)
}

local MuffledOnTweenGoals = {
	Speed = UDim.new(20, 120)
}

local MuffledOffTweenGoals = {
	Speed = UDim.new(10, 20)
}

local StraightOnTween = ts:Create(nozzle.FX.Straight, tweenOnInfo, StraightOnTweenGoals)
local StraightOffTween = ts:Create(nozzle.FX.Straight, tweenOffInfo, StraightOffTweenGoals)
local MuffledOnTween = ts:Create(nozzle.FX.Straight, tweenOnInfo, MuffledOnTweenGoals)
local MuffledOffTween = ts:Create(nozzle.FX.Straight, tweenOffInfo, MuffledOffTweenGoals)

while true do
	if ValveOpen.Value == true then
		if Pumping.Value == true then
			nozzle.FX.Straight.Enabled = true
			nozzle.FX.Muffled.Enabled = true
			StraightOnTween:Play()
			MuffledOnTween:Play()
		else
			StraightOffTween:Play()
			MuffledOffTween:Play()
			wait(2)
			nozzle.FX.Straight.Enabled = false
			nozzle.FX.Muffled.Enabled = false
		end
	else
		StraightOffTween:Play()
		MuffledOffTween:Play()
		wait(2)
		nozzle.FX.Straight.Enabled = false
		nozzle.FX.Muffled.Enabled = false
	end
	print("Checked")
	wait(0.5)
end
1 Like

it just came to my notice that the while true do doesn’t even run…

Instead of tweening to a direction, you can try using the Acceleration property on a ParticleEmitter and set the speed and direction of the particles through that

It won’t work well because the head is supposed to be spinning too, but i have just tried a simple

while true do
	print("a")
	wait()
end

and it came to my knowledge that this doesnt work neither

ok nvm so apparently you can’t tween speeds :skull:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.