How to tween Gui at the same position

Hello Everyone!

Today I want tween a gui at the same position where I tween it, so I need you help.

With CFrame I could do actually CFrame:Inverse, but I started to script in 2 dimensional Vector and it looks like easier than it is…I think so :smiley:

So as you saw on the title is the problem that I cant tween at the same position. I could easily do it with the normal Tween. So the Gui should look like this:

https://streamable.com/xiv8y3

but no! it doesnt look like that if I try it in Gui, it is mostly harder. I think so, and I learnd since 4h. I learnt everything about Gui!

Pls dont send me any Gui ressources, and help me if you can - I know a lot of dimensionale Vector and I do understand we are here in 2d Vector Space. Thanks!

So how can I fix this problem, here a video for visualize the problem better:

https://streamable.com/6m817t

As you can see it didnt start at the beginning position and didnt end at the end position, this problem seems impossible for me.

Here is the game, please try it out. If you want you can send me the data back :smiley:

concept for the gui effect.rbxl (27.7 KB)

Please help me! and thanks :smiley:

You don’t use Vector2 to move GUI, you instead use udim2. The format for it is: UDim2.new:(xScale, xOffset, yScale, yOffset) where Scale is a decimal based on the screen size (like 0.5 is halfway) and Offset is in pixels.

1 Like

Now it doesnt work could you give an example

or just fix this small problem?

What are you using to tween the GUI position? I’ll need more details to go ahead, I don’t know what you’re using to do the tween.
(I can’t open Studio right now)

I really dont know how I could do it so I did this

local TextButton = script.Parent.TextButton

local guiObject = script.Parent.ImageLabel

wait(7)

guiObject.AnchorPoint = Vector2.new(-0.3, 0,-0.32, 0)

guiObject:TweenSizeAndPosition(Vector2.new(1.6, 0,1.6, 0), Vector2.new(-0.3, 0,-0.32, 0))

I will look at some devforum post now a sec. Because I am really lost at this topic of tween

This was the script before:

local uis = game:GetService("UserInputService")

local TextButton = script.Parent.TextButton

local guiObject = script.Parent.ImageLabel

wait(7)

guiObject.AnchorPoint = Vector2.new(-0.3, 0,-0.32, 0)

guiObject:TweenSizeAndPosition(UDim2.new(1.6, 0,1.6, 0), UDim2.new(-0.3, 0,-0.32, 0))

OK, so I got the problem. Vector2 is only 2 values, not intended for GUI use. The AnchorPoint should only be Vector2.new(-0.3,-0.32) for example (it’s the right data type), but the TweenSizeAndPosition should be UDim2 INSTEAD of Vector2.

Also, If you want to see the errors it’s giving out (not all errors show in the script editor), go to the toolbar > view > output and toggle that on.

1 Like

Just set the anchor point to Udim2.new(0.5,0,0.5,0)

I dont know but this doesnt seem work still

No acutally that doesnt work. Cant anyone just fix this small script, btw is that hard to fix?

So the problem was somethingelse I fixed it by myself :smiley:

1 Like