Tween Service Help

Hello. So i’m new to LUA and learning tween service with ui but it wont work and no error and doesn’t print anything in output

local Tween = script.Parent:TweenPosition(UDim2.new(-1.063, 0,-0.008, 0)"Out","Sine",1)

if Tween then
	print("Playing")
else
	print("Error")
end

Screenshot (1404)

Thanks For Reading!

i’m assuming you forgot a comma after giving the coordinates for the ui to tween to.

script.Parent:TweenPosition(UDim2.new(-1.063, 0,-0.008, 0),"Out","Sine",1)

you don’t need a variable for it either

Thx but i’ve tried it and yet is still won’t work

It should be this

script.Parent:TweenPosition(UDim2.new(-1.063, 0,-0.008, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Sine,1)

Sorry i’ve trued that before and now and it still wont work

are you tweening to the same position that it’s already in?

Well I’m unsure about how this works with variables. Personally I don’t use variables so just try doing

script.Parent:TweenPosition(UDim2.new(-1.063, 0,-0.008, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Sine,1)

Or try doing something like

local Tween = script.Parent:TweenPosition(UDim2.new(-1.063, 0,-0.008, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Sine,1)
Tween:Play()
if Tween then
	print("Playing")
else
	print("Error")
end

No but the posistion at the script is for the target of the tween

The last parameter of the built-in tweening for GuiObjects is a callback that happens when the tween is finished/stopped, you can do something like this and do something with the returned state

script.Parent:TweenPosition(UDim2.new(-1.063, 0,-0.008, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Sine,1, true, 
	function(state)
		print(state)
	end
)

I also recommend using Enums instead of their names

sorry it still wont work and no error

Are you sure you’re tweening the correct frame? Maybe it’s meant to be script.Parent.Parent

nope its the correct fram i want it to be tween

i’ve tried it before and now and somehow it still wont work

What are you trying to do exactly if I may ask?

The only thing I can think is that you’ve got the coordinates messed up. Try copying the coordinates and pasting it into the frames position and see if it’s the same position

i did that and it still wont work :frowning:

I believe checking would only work for when using TweenService checking if a Tween is playing or not, TweenPosition is just a quick GUI transition without using the TweenService I believe

Can you try this?

local Frame = script.Parent
local TweenService = game:GetService("TweenService")
local TweenStuff = TweenInfo.new(
    Enum.EasingDirection.Out; --The EasingDirection
    1; --The Duration
    0; --Delay time when it's called
    0; --Repeat? Set as 0 if you want to play it once
    Enum.EasingStyle.Sine; -- The EasingStyle
    false --Reverses the Tween, otherwise set to false
)

local Properties = {Position = UDim2.new(-1.063, 0,-0.008, 0)}

local PlayTween = TweenService:Create(Frame, TweenStuff, Properties)

PlayTween:Play()

PlayTween:GetPropertyChangedSignal("PlaybackState"):Connect(function()
    print("The current tween state is: ", PlayTween.PlaybackState)
end)

I SWEAR I’M GOING TO SMACK MY COMPUTER FOR EVERY TIME IT FREEZES

No, paste the coordinates into the frames position in the properties, not in the code

yes i already did that and wont work

like when i paste it to its properties the cordiante is correct