I am trying to make a highlight go through RGB colours. This is my script but it is not working, and I do not know why. No error messages in console
local colour = script.Parent.Highlight.OutlineColor
local colour = script.Parent.Highlight.OutlineColor
while true do
wait(1)
colour = Color3.new(1, 0, 0)
wait(1)
colour = Color3.new(0, 1, 0)
wait(1)
colour = Color3.new(0, 0, 1)
end
When you define the colour variable you are only setting its value to be a color3. Changing that only changes the variable and doesn’t link back to the highlight. Instead you need to include some reference to the actual instance when you want to change a property:
local highlight = script.Parent.Highlight
while true do
wait(1)
highlight.OutlineColor = Color3.new(1, 0, 0)
wait(1)
highlight.OutlineColor = Color3.new(0, 1, 0)
wait(1)
highlight.OutlineColor = Color3.new(0, 0, 1)
end