So I want to use TweenService to get a smooth fade out and in, but I can't remember how you use tweens to change a background transparency. Any help is appreciated.
1 | local Frame = script.Parent -- Define your UI Object |
2 |
3 | TweenService:Create(Frame, -- Name of your UI Object |
4 | TweenInfo.new( 1 ), -- Amount of time it takes for the tween to complete |
5 | { BackgroundTransparency = 0 } ) -- Goal; what you want the tween to do |
6 | :Play() |
Like you would any other property.
1 | local tweenSrv = game:GetService( 'TweenService' ) |
2 |
3 | local tween = tweenSrv:Create( --[[Your GUI object]] , TweenInfo.new( |
4 | --[[ Amount of time it will take for the tween to complete ]] , |
5 | --[[ Easing style ]] , |
6 | --[[ Easing direction ]] , |
7 | -- The other parameters if you need them |
8 | ), { BackgroundTransparency = --[[ The value of which this property should be set to when the tween ends ]] } ) |