Unable to tween Cloud color

Hello, I am currently having an issue with tweening my cloud color for a lightning flash system.

My code is in a LocalScript that is located in StarterPlayerScripts:

local Lighting = game.Lighting
local Ambient = Lighting.OutdoorAmbient
local Clouds = game.Workspace.Terrain.Clouds
local Lightning = game.Workspace.Lightning
local Rain = game.Workspace.Rain
local TS = game:GetService("TweenService")


local CloudTween = TS:create(TweenInfo.new(1,Enum.EasingStyle.Elastic, Clouds.Color(Color3.new(1, 1, 1))))

		while true do 
		Clouds.Color = Color3.new(0.0980392, 0.0980392, 0.0980392)
		Lighting.Ambient = Color3.fromRGB(64, 64, 64)
		wait(math.random(0, 10))
		Lightning.Playing = true
		--Clouds.Color = Color3.new(1, 1, 1)
		CloudTween:Play()
		Lighting.Ambient = Color3.fromRGB(118, 118, 118)
		wait(4.1)
		Clouds.Color = Color3.new(0.0980392, 0.0980392, 0.0980392)
		Lighting.Ambient = Color3.fromRGB(64, 64, 64)
		wait(math.random(0, 2))
end


you haven’t mentioned the object while creating tween

Clouds.Color

is my object to tween…?

As you can see named here:

local Clouds = game.Workspace.Terrain.Clouds

no ig that’s not how tween works, you must do this instead TS:Create(Clouds, TweenInfo.new(1,Enum.EasingStyle.Elastic,Enum.EasingDirection.Out), {color = coloe3.new(1, 1, 1)})

1 Like

I know this is not very closely related but I am trying to replicate this for my OutdoorAmbience, and I am unable to (probably the from.RGB(color)

local Lighting = game.Lighting
local Ambient = Lighting.OutdoorAmbient
local Clouds = game.Workspace.Terrain.Clouds
local Lightning = game.Workspace.Lightning
local Rain = game.Workspace.Rain
local TS = game:GetService("TweenService")


local CloudTweenLight = TS:Create(Clouds, TweenInfo.new(1,Enum.EasingStyle.Elastic,Enum.EasingDirection.Out), {Color = Color3.new(1, 1, 1)})
local CloudTweenDark = TS:Create(Clouds, TweenInfo.new(1,Enum.EasingStyle.Elastic,Enum.EasingDirection.Out), {Color = Color3.new(0.0980392, 0.0980392, 0.0980392)})
local AmbientTweenLight = TS:Create(Lighting.Ambient, TweenInfo.new(1,Enum.EasingStyle.Elastic,Enum.EasingDirection.Out), {Ambient = Color3.fromRGB(118, 118, 118)})
local AmbientTweenDark = TS:Create(Lighting.Ambient, TweenInfo.new(1,Enum.EasingStyle.Elastic,Enum.EasingDirection.Out), {Ambient = Color3.fromRGB(64, 64, 64)})
		while true do 
		Clouds.Color = Color3.new(0.0980392, 0.0980392, 0.0980392)
		Lighting.Ambient = Color3.fromRGB(64, 64, 64)
		wait(math.random(0, 10))
		Lightning.Playing = true
		CloudTweenLight:Play()
		AmbientTweenLight:Play()
		wait(2)
		CloudTweenDark:Play()
		wait(2)
		AmbientTweenDark:Play()
		wait(math.random(0, 2))
end


No worries if you do not know.

try removing this line from your script

1 Like

Ah, never mind I actually figured it out.
I replaced Lighting.Ambient to Lighting. Then I changed the Color to Ambient (or OutdoorAmbient it doesn’t matter)

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