How can someone make a RGB glitch effect for a main menu

Hey there everyone! So today I am trying to create a RGB glitch effect for a main menu, and I’ve added a Tween function but don’t actually know how to bring that RGB effect to life. Can I get some help as to how I can recreate this effect?

wait(3)
script.Parent:TweenPosition(UDim2.new(0.42,0,0.405,0),"InOut","Bounce",1)
wait(15)
script.Parent:TweenPosition(UDim2.new(0.427,0,0.405,0),"InOut","Bounce",1)
1 Like

You sure won’t get a good “glitchy” effect if you play a 1 second tween then wait 15 seconds :joy:

In all seriousness, I would just do something like this for an RGB effect. I have no clue what your UI looks like. You could make a separate script rapidly flash the colors and then have this as the moving script:

while true do
wait(math.random(0.5,1))
script.Parent:TweenPosition(UDim2.new(0.42,0,0.405,0),"InOut","Bounce",1)
wait(math.random(1,3))
script.Parent:TweenPosition(UDim2.new(0.427,0,0.405,0),"InOut","Bounce",math.random(.5,1)
wait(math.random(1,2))
end

This should give it a rapid, glitchy and random feel.

2 Likes

To achieve RGB effect, you need to use a for-loop and Color3 lerp.

--gui object
local guiObject
--colors
local redColor = Color3.new(1, 0, 0)
local greenColor = Color3.new(0, 1, 0)
local blueColor = Color3.new(0, 0, 1)
--main code
guiObject.BackgroundColor3 = redColor
for i = 0, 100, 1 do
   guiObject.BackgroundColor3 = guiObject.BackgroundColor3:lerp(greenColor, i/100)
   wait()
end

Because Color3:lerp() returns a Color3 value, it does not tween.

1 Like

Ooh this sounds like a more “proper” way of obtaining this effect. I’ll be sure to try it out!

1 Like

As of now, I currently created a imagebutton as a play button in photoshop, made a duplicate that has a RGB effect on it, and messed with that in studio. I’ll try the script you’ve provided me with!

1 Like