#Tweening UI not working

28 messages · Page 1 of 1 (latest)

spice palm
#

I have a very simple script to tween the position of a frame. The position of the frame prints 0,0,0,0 even though it should be at 0,0,1,0. If I switch out position for transparency it works fine. Why doesn't the position tween?

local TweenService = game:GetService("TweenService")
script.Parent.Visible = true
wait(5)
local background = script.Parent
local tween = TweenService:Create(background, TweenInfo.new(1, Enum.EasingStyle.Circular, Enum.EasingDirection.Out), {Position = UDim2.new({0, 0},{1, 0})})
tween:Play()
tween.Completed:Wait()
print(background.Position)
golden otter
#

remove the {}s in your udim2

#
local TweenService = game:GetService("TweenService")
script.Parent.Visible = true
wait(5)
local background = script.Parent
local tween = TweenService:Create(background, TweenInfo.new(1, Enum.EasingStyle.Circular, Enum.EasingDirection.Out), {Position = UDim2.new(0, 0, 1, 0)})
tween:Play()
tween.Completed:Wait()
print(background.Position)
spice palm
real linden
#

you dont need it

spice palm
#

{Position = UDim2.new(0,0,1,0) }

real linden
#

oh wait im stupid

#

yeah my bad

#

how does your tween look like btw?

spice palm
paper viper
#

Btw I think this tween.Completed:Wait() is wrong

#

Pretty sure it was tween:Completed()

#

Also, any errors?

spice palm
paper viper
#

Show us a before and after maybe

spice palm
#

Its just a placeholder right now

real linden
spice palm
#

I'm experimenting with place teleporting and its for a teleport ui

paper viper
#

Can you show the position of the gui before?

#

show/tell

#

you know what I mean

spice palm
#

you join the game and it takes up the whole screen then tweens out of screen

paper viper
#

So by default the position is (0,0, 0,0)?

spice palm
undone lance
#

@spice palm is your problem solved?