Hello! I am trying to make my UI have a fade in effect (it flys up and fades in)
The one issue I am having is trying to add position (making the Y scale go from 0.85 > 0.9)
I tried to use Position.Scale.Y to try to make it work but it didn’t.
Does anybody know how to do it?
The code is here:
local StatusCall = game.ReplicatedStorage.StatusMessage
local player = game.Players.LocalPlayer
local Enabled = player.Backpack.KeybindFlashlight.HasFlashlight
StatusCall.OnClientEvent:Connect(function()
if Enabled == true then
script.Parent.Text = "You already have this."
else
script.Parent.Text = "You have gained: 'Flashlight'"
end
script.Parent.Position = UDim2.new(0.5,0,0.9,0)
for i = 1,10 do
script.Parent.TextTransparency += 0.1
script.Parent.Position.ScaleY += 0.015
end
wait(5)
for i = 1,10 do
script.Parent.TextTransparency -= 0.1
end
end)
local TweenService = game:GetService("TweenService")
local ThisText = -- Instance
local AnimateInfo = TweenInfo.new(
1, -- Interval
Enum.EasingStyle.Sine, -- Style
Enum.EasingDirection, -- Direction for animation (Check the Hub for more info)
0, -- Repeat count (-1 for infinite repeat)
false, -- Reverse
0 -- Delay time
)
local Goal = {
-- Properties that you will animate
Position = UDim2.new(1, 0, 1, 0),
Size = UDim2.new(1, 0, 1, 0),
TextTransparency = 1,
}
local AnimateThis = TweenService:Create(ThisText, AnimateInfo, Goal)
AnimateThis:Play() -- Run