I want to make a transition from a Loading screen to a Game menu
All I need is a script to slowly make some parts of the gui go invisible, but I can’t figure it out, I’ve tried this:
I want the frame transparency to go up until it reaches 0.8 transparency
but it never closes the loading screen gui so the game menu never shows up and the code glitches.
Note: It DOES transition, but I dont know how to stop the code after 0.8 transparency. it does stop at 0.8 transparency but It won’t close the loading screen gui.
Well, that is because you are repeating a loop that is not considering a condition and it is not good practice to write code that way, because it can be overridden in many ways, but the most optimal way is with the TweenService, as follows:
local TweenService = game:GetService("TweenService")
local info = TweenInfo.new(ANIMATION TIME, Other parameters that for this case I don't think you need)
TweenService:Create(Frame, info, {Transparency = 0.8}):Play()
Basicly, first we call the interpolation service, then we create a variable that saves the animation settings that accepts parameters such as time, etc. that you can consult on the roblox page and its documentation
local info = TweenInfo.new()
Finally we call the service and ask it to create an animation in which we first specify the instance to animate, then the tweenInfo.new (which in the code I wrote for you I replaced with the variable that already has it saved) and then a table in which the properties to Animate are specified in this case {Transparency = 0.8} because we want it to reach 0.8, and we reproduce it with the :Play()
You can’t. Tweens have more quality and are recommended but come at a cost to a slight bit of memory and performance. You must decide which one you will use.
I recommend that you use the TweenService, just like SubtotalAnt8185 works, but in this the tweenService is more optimizable since you already define up to the time of the Animation, and that cannot be done with the loop, but both work the same
I used your code, but it didn’t work, here’s the code that Im using from your example, also im trying to make it so a text is more visible, not a frame.:
local TweenService = game:GetService("TweenService")
local info = TweenInfo.new()
TweenService:Create(gameMenu.Frame.Button.TextTransparency, info, {Transparency = 0}):Play()
Yes. You can change the 2 to whatever time you want it to fade.
local TweenService = game:GetService("TweenService")
local info = TweenInfo.new(2)
TweenService:Create(gameMenu.Frame.Button, info, {TextTransparency = 0}):Play()