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

Color is not going direct to the color but it goes slowly?

Asked by 4 years ago

I want this script to go directly to another color, not slowly Please help me with this, Thanks!

-- Again, LocalScript in StarterPlayer.StarterPlayerScripts
local RS = game:GetService('RunService')
local tweenService = game:GetService('TweenService')

local waitTime = 0.25
local easingStyle = Enum.EasingStyle.Linear
local easingDirection = Enum.EasingDirection.In

local colorTweenInfo = TweenInfo.new(waitTime, easingStyle, easingDirection, 0, false, 0)

local soundie = game.Workspace.Sound
local part = game.Workspace.T

local function getNewColor()
    local pLoudness = soundie.PlaybackLoudness
    local randX = math.random(0, pLoudness) / 800
    local randY = math.random(0, pLoudness) / 800
    local randZ = math.random(0, pLoudness) / 800

    local newColor = Color3.new(randX, randY, randZ)
    return newColor
end

local function createColorTween()
    local newColor = getNewColor()
    local tween = tweenService:Create(part, colorTweenInfo, {Color = newColor})

    return tween
end

while true do
    wait(0.1)
    if soundie.IsPlaying then
        local tween = createColorTween()
        tween:Play()
        tween.Completed:Wait()
    end
end

0
I'm not good with tweening but cant you just change the wait time value to 0? cmgtotalyawesome 1418 — 4y
0
I've already tried that, for some reason it does not work, it works a little bit for me JustSxript 36 — 4y

Answer this question