Surface Gui Tweening Enabled Value?

local TweenService = game:GetService("TweenService")
local screen = script.Parent.Parent.SurfaceGui
local changevalue = false
local info = TweenInfo.new(2)
local tweenthing = TweenService:Create(screen, info, {Enabled = changevalue})





script.Parent.MouseButton1Click:Connect(function()
	tweenthing:Play()
	wait()
end)

So what I am trying to accomplish is having the surfaceUI enabled property fade smoothly from true to false. I am not even sure if this is possible, or If I would have to do something else to get the effect… Are you able to tween from true to false smoothly? it works to an extent. but it shows it abruptly. I don’t think it is something that is supposed to be tweened in that kind of way… and Nothing else including the video inside of the surfaceUI has NumberValues for their visibility, and Surface UI only has an enabled property. I haven’t found anything on the forum about this, but that could because SurfaceUI’s aren’t supposed to fade using tweens (Idk if it is) . If you could let me know if that is the case… Thanks in Advance.

Like ScreenGUI, this wasn’t how you should fade them as it’s container object, TweenService works on 3D and 2D GUI elements only (even values) but since you’re tweening a boolean on an class that is just container, it’s gonna tween instantly which means it works like we toggle a property, You have to create a tween for each UI object in that Container or if you’re gonna fade the GUI with one line without having to create a fade for each GUI elements, i suggest using CanvasGroup for time saving but this also makes the UI blurry if devices do not have enough memory. not sure if it’s gonna render on it but i only use it on ScreenGUI

local screen = <path_to_your_instance>
local tweenSV = game:GetService("TweenService")
local TINFO = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)

--TINFO represents as TweenInfo
--Property to fade including BackgroundTransparency, ImageTransparency, TextTransparency etc.
--If it's CanvasGroup, use GroupTransparency and make sure all UI is inside CanvasGroup otherwise it won't fade all of the children.


local fade_in = tweenSV:Create(screen, TINFO, {-- see line 6 for property list}) --e.g ImageTransparency = 0
script.Parent.MouseButton1Click:Connect(function)
  fade_in:Play()
end
1 Like

But how would I fade out the VideoFrame? It has only a boolean value for it’s visibility. not numbers.