What I'm currently trying to do is make a color changing script using tweening and I'm trying to use it on a string of LED models that I had compiled. The script itself works perfectly fine if, for instance, I paste the script into the object and call for that object it works as attended, but currently I'm trying to get the children of a folder that holds all the LED meshparts and when I attempt to apply the color to the children it gives me the error "Unable to cast value to Object".
local ledFolder = game.Workspace:WaitForChild("ledFolder") local ledLights = ledFolder:GetChildren() local TweenService = game:GetService("TweenService") local TweeningInformation = TweenInfo.new( 2, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, -1, true, 0 ) local PartProperties = { Color = Color3.fromRGB(135, 13, 165) } local Tween = TweenService:Create(ledLights,TweeningInformation,PartProperties) Tween:Play()
This is the entirety of the script, the script itself is placed in ServerScriptService. I've attempted making a separate table of all the LEDs as well as tried calling for BrickColor. Any help or pointers to why it won't apply the color value to the meshparts in the folder would be greatly appreciated.