Color not changing

I put a Script under a “Highlight” part, and I’m not sure whatever script I have currently even works with it.

local TweenService = game:GetService("TweenService")
local part = script.Parent
local TweeningInformation = TweenInfo.new(
	0.1,
	Enum.EasingStyle.Quad,
	Enum.EasingDirection.Out,
	753475938457843579348573,
	true,
	0
)

local PartProperties = {
	Color = Color3.new(0,0,0)
}

local Tween = TweenService:Create(part,TweeningInformation,PartProperties)
Tween:Play()

Screen Shot 2023-11-10 at 4.34.29 PM

Other tweaks i need: Is there a better way to continuously have the color change instead of having a high number for a repeat count, and easier way to make it switch between 2 colors repeatedly? (for this example i have it change from black to white, back and forth)

3 Likes

Color3.fromRGB() instead of Color3.new()

2 Likes

Still doesn’t work.
Not sure if it’s the issue with what properties a highlight part uses, since it uses “OutlineColor”

1 Like

Change Color to FillColor

1 Like

Screen Shot 2023-11-10 at 4.48.56 PM

This is the only color property there, changing “Color” to “FillColor” won’t do anything

1 Like

You should help yourself after I help you cause this seems a little cursed.

Here’s the latest fixed script since I can’t explain too well. Please use cases properly
Method 1

local TweenService = game:GetService("TweenService")

local part = script.Parent
local tweenInfo = TweenInfo.new(
	0.1,
	Enum.EasingStyle.Quad,
	Enum.EasingDirection.Out
)

local partProperties = {
	FillColor = Color3.fromRGB(0,0,0)
}

local altPartProperties = {
	FillColor = Color3.fromRGB(255, 255, 255)
}

local mainTween = TweenService:Create(part,tweenInfo,partProperties)

local altTween = TweenService:Create(part,tweenInfo,altPartProperties)

mainTween.Completed:Connect(function()
	altTween:Play()
end)

altTween.Completed:Connect(function()
	mainTween:Play()
end)

mainTween:Play()

Method 2 cause this is fun to solve like legos

local TweenService = game:GetService("TweenService")

local part = script.Parent
local tweenInfo = TweenInfo.new(
	0.1,
	Enum.EasingStyle.Quad,
	Enum.EasingDirection.Out,
	1,
	true
)

local partProperties = {
	FillColor = Color3.fromRGB(0,0,0)
}

local mainTween = TweenService:Create(part,tweenInfo,partProperties)

mainTween.Completed:Connect(function()
	mainTween:Play()
end)

mainTween:Play()

And my eyes hurts trying to debug this. You’re welcome.

1 Like

Tweaked this a bit, but the color isn’t going from black to red repeatedly, nor smoothly, as I tried to make it do.

local TweenService = game:GetService("TweenService")

local part = script.Parent

local tweenInfo = TweenInfo.new(
	0.1,
	Enum.EasingStyle.Quad,
	Enum.EasingDirection.Out
)

local goal = {}
goal.OutlineColor = Color3.new(1,0,0)

local mainTween = TweenService:Create(part,tweenInfo,goal)

mainTween:Play()
1 Like

Try method 2 with default being red and replace FillColor with OutlineColor

1 Like

Additional note - setting the RepeatCount to a negative number like -1 will make the tween repeat indefinitely.

3 Likes

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