Hello,
I need to tween a ColorSequence inside a ParticleEmitter, thing is, the particles need only 1 single color so I was wondering if there was a way to tween the 1 keyframe inside ColorSequence or if there was a way to convert Color3 to a ColorSequence. I’ve already read
but they are talking about a multiple-keyframed ColorSequence, I only need 1 color.
Thanks.
That won’t work, as all ColorSequences have to have at least 2 color sequence keypoints, first keypoint has to have a time of 0 and the last keypoint has to have a time of 1.
Thanks for your replies, currently Roblox isn’t working properly and I can’t test what I wanted to test, I’ll let you know if any of what you replied works as soon as Roblox is working again
Not able to use Studio rn because I’m on my study laptop, but I whipped up this code and maybe you could try this:
local firstColor = --A color3
local colorSequence = ColorSequence.new(firstColor)
local notNeeded = --a random part, will be used later but may or may not be used in game
notNeeded.Color = firstColor
local toTween = --Another color3
local TweenService = game:GetService("TweenService")
local info = TweenInfo.new(--[[tweenInfo]])
local tween = TweenService:Create(notNeeded, info, {Color = toTween})
local runService = game:GetService("RunService")
local function AFunction()
local currentColor = notNeeded.Color
colorSequence = ColorSequence.new(currentColor)
--Do whatever
task.wait()
end
tween:Play()
local connection = runService.Heartbeat:Connect(AFunction())
tween.Completed:Wait()
connection:Disconnect()