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

Roblox bug or is it my?

Asked by
Kurieita 125
9 years ago

I am trying to change the position of a gui by using either the up arrow key or the down arrow key. For some reason B prints but the position doesn't change, but if I move B to where A is, it want to work. Both A and B work, but B position doesn't change, only A. Sorry if this is confusing, it will make more sense when you read the code.

if Direction == Enum.KeyCode.Up then
    Button.Position = UDim2.new(0, 0, 0, Button.Position.Y.Offset - 160)
    print("A")
elseif Direction == Enum.KeyCode.Down then
    Button.Position = UDim2.new(0, 0, 0, Button.Position.Y.Offset + 160)
    print("B")
end

Any suggestions or tips will help, thanks.

0
I can't see any reason this won't work. Do you have a Model or example Place I could take a look at? adark 5487 — 9y
0
Not really Kurieita 125 — 9y
0
Are you redefining Button anywhere? That is the only possible problem I can think of YellowoTide 1992 — 9y
0
Nope Kurieita 125 — 9y

Answer this question