Unable to cast value to Object; Tween:Create()

Hi! So, uh; this script do a tween in a ColorCorrectionEffect, but, I every time get Unable to cast value to Object in Output.

This LocalScript are in StarterGui

local light = game.Lighting.ColorCorrection
local highlight = game.Players.LocalPlayer.Character:WaitForChild("Highlight")

local tween = game:GetService("TweenService")

local lightgoal_start = { Saturation = -1 }
local lightgoal_end = { Saturation = 0 }

function Damage()
	
	local info = TweenInfo.new(.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0)
	
	light = lightgoal_start
	highlight.Enabled = true 
	wait(.1)
	tween:Create(light, info, lightgoal_end):Play()
	highlight.Enabled = false
end

damageevent.OnClientEvent:Connect(Damage)

It’s because you are trying to tween a table.

Thanks! Actually, my error was at using the table for set the saturation without Tween.


it work now.

1 Like

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