Heyo, i'm back with another question.. So i have like a cinematic bar and i want it to move up when u click a button (the cinematic bar is not allowed to go back btw) I'm new to tweening so i dont understand much of it.
Here is the script any improvements or tips are welcome! Thank you for reading.
local text = script.Parent.TextButton local size = 50 local blur = game.Lighting.Blur local credits = script.Parent.credits local birthday = script.Parent.birthday local CutBlur = game.Lighting.CutBlur local camera = game.Workspace.CurrentCamera local bar1 = game.StarterGui.ScreenGui.bar1 local bar2 = game.StarterGui.ScreenGui.bar2 text.MouseButton1Click:Connect(function() game.Players.LocalPlayer:WaitForChild("PlayerGui").TPGUI.Enabled = false --For going down for i = 1, 10, -1 do blur.Size = i wait(.1) end blur.Enabled = false camera.CameraType = Enum.CameraType.Custom bar1:TweenPosition(UDim2.new(0, 0,0, 0),"In", "Quad",1) bar1:TweenPosition(UDim2.new(0, 0,0.999, 0) ) print("Menu succefull, thanks to some amazing people") end)
(this is not the full script but only the tweening part and the locals)
So basically, what you did wrong is you didn't add tween info on bar1's second tween position. You must define the direction, duration, style, and time like you did in the one above.
For more information on TweenPosition
I would check out the TweenPosition Wiki.
A basic example of TweenPosition
for your implementation is:
guiObject:TweenPosition( UDim2.new(1, 0, 1, 0), -- Final position the tween should reach Enum.EasingDirection.In, -- Direction of the easing Enum.EasingStyle.Sine, -- Kind of easing to apply 2, -- Duration of the tween in seconds true -- Whether in-progress tweens are interrupted )
I do not take credit this example is on the wiki