so when u hover over a button it would decrease size smoothly and when u click it decreases then increases back to normal smoothly, how would i do this
also how would i make it so when the button is clicked it would tween up to cover the screen, heres what i mean:
(i dont want pauses i just had to put my finger down on my trackpad )
Use the Tween.Completed
event to create another tween which increases the size maybe? There might be a better way, though.
for this its a simple line
Frame:TweenPosition(Udim2.FromScale(0,0)) --Then do any sort of easing style/direction.
Note that the Udim2 of 0,0 only applies to the frame if it has an anchor point of 0,0. If your anchor point is something other than 0,0 then just set the position (Scale) to the anchor point to get the effect you’re looking for.
i am not at all experienced with tweens i never used them
here, try this then.
Frame:TweenPosition(UDim2.fromScale(0,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine)
Just a simple Tween. Replace ‘Frame’ With your frame.
I recommend also reading these: Tween | Documentation - Roblox Creator Hub and GuiObject | Documentation - Roblox Creator Hub. You should (technically) use TweenService
instead of :TweenPosition
, but it’s up to you.
um i got this error:
attempt to call a nil value
That means your Frame is nil. Did you replace Frame
with the path to the frame? I also forgot some capitalisation, try it with my updated version.
this is my script rn:
script.Parent.MouseButton1Click:Connect(function()
local Frame = script.Parent.Parent.Frame
Frame:TweenPosition(UDim2.FromScale(0,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine)
end)
That looks like it should work, try it again maybe? Make sure the ‘F’ in fromScale
isnt capitalised.
oh wait ye now its working FromScale was supposed to be fromScale