How to tween size of a frame from the top to the bottom

Hello developers

I want to make that a frame get tinier from the top to the bottom, like an eye.

This is my code:

while wait(3) do
	for i,Eye in pairs(script.Parent:GetChildren()) do
		if Eye:IsA("Frame") then
			
			local function OpenEyes()
				wait(0.1)
				Eye:TweenSize(
					UDim2.fromScale(0.25,0.53),
					Enum.EasingDirection.InOut,
					Enum.EasingStyle.Sine,
					0.3,
					true
				)
			end
			
			Eye:TweenSize(
				UDim2.fromScale(0.25,0.02),
				Enum.EasingDirection.InOut,
				Enum.EasingStyle.Sine,
				0.3,
				true,
				OpenEyes,
				false
			)
	
		end
	end
end

But this is what happens.

Does anyone knows how to achieve this?

Do you mean the reverse of this? Try playing around with anchor points, I believe that is what you will need to achieve this.

bring down the position as the size reduces.

Oh, that was quite easy, thanks

1 Like