Recently I was in the process of remaking my obby, I need some help with scripting a smooth transitioned color changing part using the “onTouch” function.
local ColorChange = script.Parent
function onTouched()
wait(0.2)
ColorChange.Touch:Connect(onTouched)
ColorChange.Material = Enum.Material.Neon
ColorChange.Color = Color3.fromRGB(6, 189, 255)
wait(0.2)
ColorChange.TouchEnded:Connect(onTouched)
ColorChange.Material = Enum.Material.Plastic
ColorChange.Color = Color3.fromRGB(0, 0, 0)
end
For some reason, this script doesn’t work, and the output log shows nothing. Whenever a user steps on this part, the black color should transition to light blue. However, when the user stops stepping on the part, it should then return to its original color and material. Any help is appreciated!