UI tween zoom in

When I do the other numbers it goes in a totally different direction. 0.5. But 0 keeps it kn the middle

Hmm, I’m a bit confused. AnchorPoints have 2 properties: X and Y.
The top part’s AnchorPoint should be 0.5,1, it should create the illusion that it’s closing to the centre but downward
The bottom part’s AnchorPoint should be 0.5,0, creating an anchor at the top, giving the illusion that it’s closing from the centre but upward. It should sort of meet in the middle of the 2 frames.

not the exact middle, but i want it to start where it is rn but itll just zoom into it like the script does. the bottom zomes fine from its place but the top blue part starts a little diffrent place

Can you send a video? I’m still a little unsure what you mean haha

blue part at top kinda starts somewhere diffrent https://gyazo.com/8ef82d038a578876e3b6a8eab87823ee

Ohhh I see, if you want it to be constantly attached to the frame, I recommend putting the top part inside of the frame and just size it accordingly, its size would probably be like 1.1, 0, 0.1, 0. You should then be able to just get rid of the references to the top part and it should work as normal.

i kinda want it like this, both frames start diffrent, not attached at first. Tween

oh wait i fixed it, okay great. now i just gotta play around with the times the tweens come in. thanks

1 Like

oh and by any chance is there a way to add a small weight timer to the script after the second one plays?

tweens = {
		[frame1] = {
		['Open'] = tweenService:Create(frame1, tweenInfo, {Size = UDim2.new(5.2, 0,0.5, 0)});
			['Close'] = tweenService:Create(frame1, tweenInfo, {Size = UDim2.new(0,0,0,0)});
		};
		[frame2] = {
		['Open'] = tweenService:Create(frame2, tweenInfo, {Size = UDim2.new(4.98, 0,5.31, 0)});
			['Close'] = tweenService:Create(frame2, tweenInfo, {Size = UDim2.new(0,0,0,0)});
		};
		[frame3] = {
		['Open'] = tweenService:Create(frame3, tweenInfo, {Size = UDim2.new(0.944, 0,0.266, 0)});
			['Close'] = tweenService:Create(frame2, tweenInfo, {Size = UDim2.new(0,0,0,0)});
		};
	};

Oh yeah you definitely can, you’d do something like this probably:

tweens = {
		[frame1] = {
		    ['Open'] = tweenService:Create(frame1, tweenInfo, {Size = UDim2.new(5.2, 0,0.5, 0)});
			['Close'] = tweenService:Create(frame1, tweenInfo, {Size = UDim2.new(0,0,0,0)});
            ['TimeToWaitBeforeNextFrame'] = 0.1
		};
        [frame2] = {
            ['Open'] = tweenService:Create(frame2, tweenInfo, {Size = UDim2.new(4.98, 0,5.31, 0)});
			['Close'] = tweenService:Create(frame2, tweenInfo, {Size = UDim2.new(0,0,0,0)});
            ['TimeToWaitBeforeNextFrame'] = 0.5;
        -- etc...

-- ...

script.Parent.Parent:WaitForChild('Open').MouseButton1Click:Connect(function()
	open = not open
	local tempIsOpen = open
	for i,v in ipairs(frames) do
		if tempIsOpen ~= open then
			return
		end
		local chosenTween = tweens[v][open and 'Open' or 'Close']
		chosenTween:Play()
		task.wait(tweens[v].TimeToWaitBeforeNextFrame)
	end
end)

wow this is amazing! thank you so much

1 Like