i want the frame to move up when i click a button.. it isn't working..
1 | local frame = script.Parent.Parent.Parent.Frame |
2 | local enabled = false |
3 | script.Parent.MouseButton 1 Click:Connect( function () |
4 | if enabled = = false then |
5 | frame.Position = Vector 2. new( 0 , 1 , 0 ) --move up i think |
6 | enabled = true |
7 | end |
8 | end ) |
pleas help if possible!
You shouldn't use Vector2 for Frames, you should use UDim2.new(). Read more about UDim2 here.
1 | frame.Position = UDim 2. new( 0 , 0 , 0 , 0 ) -- make sure to edit these values! |
If this helps, then please accept this answer!
Well, perhaps an easier way is if you used TweenService.
1 | frame:TweenPosition(UDim 2. new( 0 , 0 , 0 , 0 ), "InOut" , "Sine" , 1 ) |
Make sure you edit the position (the 4 numbers) into the position you want it to go to.