Tweening Frame Happening Backwards?

I am trying to make the frame tween the opposite way, not the way it does in the video.
I have the size correct (I manually changed the size to be how I wanted it, then copy and pasted it into the code.
I also tried changing the position along with the size (since I noticed that the position was changing when the size was.

Code:

script.Parent.MouseEnter:Connect(function()
	script.Parent.Frame:TweenSizeAndPosition(UDim2.new(0, 200,0, 140),UDim2.new(0, 0,0.967, 0),Enum.EasingDirection.In,Enum.EasingStyle.Linear,.5,true)
end)

script.Parent.MouseLeave:Connect(function()
	script.Parent.Frame:TweenSizeAndPosition(UDim2.new(0, 200,0, 10),UDim2.new(0, 0,0.967, 0),Enum.EasingDirection.In,Enum.EasingStyle.Linear,.5,true)
end)

Video:


Explorer:
image

Then do it the other way:

script.Parent.MouseEnter:Connect(function()
script.Parent.Frame:TweenSizeAndPosition(UDim2.new(0, 200,0, 10),UDim2.new(0, 0,0.967, 0),Enum.EasingDirection.In,Enum.EasingStyle.Linear,.5,true)
end)

script.Parent.MouseLeave:Connect(function()
	script.Parent.Frame:TweenSizeAndPosition(UDim2.new(0, 200,0, 140),UDim2.new(0, 0,0.967, 0),Enum.EasingDirection.In,Enum.EasingStyle.Linear,.5,true)
end)

Make sure to change the starting size to what you want the player to see first.

Although I am not entirely sure why you want the description to be hidden when a player hovers over it. The video would make more sense.

1 Like

What do you mean?
The text would be visible when the player hovers.

1 Like

The text is already visible, correct?

1 Like

I want it to be like it is in this video.

Yes that is correct, I am using ClipDescendants on the frame.

Ah I see what you mean now, I thought you meant reverse the tween.

Yep. I have no idea why studio is doing this to me lol.

What I like to do when I am tweening gui’s is I like to, in studio, not testing, size the frame to the starting postition, write the position and size down on a script comment, then do the same thing for the what you want after tweening (changed the size and position to the final goal and write the position and size on a script comment) then I type in the tweensizeandposition function with the size and position from my script comments. It’s just easier for me.

Yeah, I do it that way also. All the values are correct, but Roblox won’t tween it properly.

Move your anchor point to the bottom, it could be because the top left is considered the center of your gui. I’m not exactly sure if this is correct though

If the anchor point is that 0,0 is that the bottom?

I don’t normally use anchor point (translation: I have never used anchor point before)

0,0 is the top left, you want to use 0.5,1

1 Like

This site has more info on it: Anchor Point

Changing the anchor point worked! :smiley:

Glad I could help! Sorry it took a while, I am somewhat new to scripting.

1 Like

Its ok. You are new the scripting and already better than me!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.