Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why will the frame not move when i click the button?

Asked by 4 years ago

i want the frame to move up when i click a button.. it isn't working..

local frame = script.Parent.Parent.Parent.Frame
local enabled = false
script.Parent.MouseButton1Click:Connect(function()
if enabled == false then
        frame.Position = Vector2.new(0,1,0) --move up i think
enabled = true
end
end)

pleas help if possible!

2 answers

Log in to vote
1
Answered by 4 years ago

You shouldn't use Vector2 for Frames, you should use UDim2.new(). Read more about UDim2 here.

frame.Position = UDim2.new(0,0,0,0) -- make sure to edit these values!

If this helps, then please accept this answer!

0
how do i add to the value cause +1 doesn't work peytonallen920 66 — 4y
0
this put me on the right track peytonallen920 66 — 4y
Ad
Log in to vote
1
Answered by
Ieowyyn 69
4 years ago

Well, perhaps an easier way is if you used TweenService.

frame:TweenPosition(UDim2.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.

Answer this question