I want to make a main menu for my and my friend’s horror game and the menu is on a Computer (the menu is a surface UI) and I want to make it so the screen image moves creating a ‘‘Glitch Effect’’ (The screen image looks like this:
And I want the background of the screen to move up and back to the original position (Screen Glitch effect)
I tried to script that effect myself and it didn’t work and it feels really embarrassing that I messed up such a simple script
This is the script:
local Screen = script.Parent.Screen
local ScreenUp = script.Parent.ScreenUp
Screen.Transparency = 0.61
wait(10)
ScreenUp.Transparency = 0.61
wait(0.1)
ScreenUp.Transparency = 1 --I'm planning to adding loop for the function so it doesn't happen only once--
There were no posts about a similar problem.
There were no error messages in the output and when I checked the image transparency while in game it was still fully transparent.
If I’m right, you can’t change the image’s transparency. However if you want it to move, change the position, Use
ScreenUp.Position = UDim2.new(0,0,0,0) -- Change this to whatever
and if you want it inside a loop, you could do it like this
while wait(.1) do
ScreenUp.Position = UDim2.new(0,0,0,0) -- Change this to whatever
wait(.1)
ScreenUp.Position = UDim2.new(0,0,0,0) -- Change this to whatever
end
I genuinely don’t think that is a surface GUI, if you would like to accomplish something exactly like that you could insert a regular GUI in the same position as the computer if the camera won’t move.
Hold up, what position are you changing? is it a gui or are you changing the surfacegui’s position? Cause a surfacegui doesn’t have a position, it just contains guis.
local Screen = script.Parent.Screen
local ScreenUp = script.Parent.ScreenUp
local Heavy = script.Parent.ScreenHeavy
ScreenUp.Position = UDim2.new(0,0,0,0)
wait(.1)
ScreenUp.Position = UDim2.new(0,0,0,-10) -- Change this to whatever
wait(.1)
ScreenUp.Position = UDim2.new(0,0,0,0)
while wait(.1) do
ScreenUp.Position = UDim2.new(0,0,0,0) -- Change this to whatever
wait(.1)
ScreenUp.Position = UDim2.new(0,0,0,-10) -- Change this to whatever
end