I want to make a gui go in a direction when I press a certain key. For example, W is up. I think the code should look like this, but I don't know how to get it to work.

function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.W then
position.GUI X + 0.01
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)

Please answer. Thanks!

2 comments

0

what kind of script is it in, and where?

0

It would help if we could see the layout you have in the explorer, if you could post that it would be a great help. Also, is this the full script?