function moveMenu(actionName, inputState, inputObj) if inputState == Enum.UserInputState.Begin then if GuiService.SelectedObject ~= nil then if (inputObj.KeyCode == Enum.KeyCode.Left or inputObj.KeyCode == Enum.KeyCode.A) then changeAngleOffset(-45) elseif (inputObj.KeyCode == Enum.KeyCode.Right or inputObj.KeyCode == Enum.KeyCode.D) then changeAngleOffset(45) end selectSound:Play() end end end function thumbstickMoveMenu(actionName, inputState, inputObj) if inputState == Enum.UserInputState.Begin then local pos = inputObj.Position if GuiService.SelectedObject ~= nil then changeAngleOffset(45 * math.sign(pos.X)) end selectSound:Play() end end
These functions are supposed to make a GUI rotate 45 degrees in a given direction with the arrow keys and left thumbstick, respectively.
However, while both of them are in the console's ActionBindings list, they don't do anything, and nothing is showing up in the output, so I'm not sure what the problem is.
UserInputService.InputBegan:Connect(function(inputObj, processed) if menuOpen == true and GuiService.SelectedObject ~= nil then if (inputObj.KeyCode == Enum.KeyCode.Left or inputObj.KeyCode == Enum.KeyCode.A) then changeAngleOffset(-45) elseif (inputObj.KeyCode == Enum.KeyCode.Right or inputObj.KeyCode == Enum.KeyCode.D) then changeAngleOffset(45) end end end) UserInputService.InputChanged:Connect(function(inputObj, processed) if menuOpen == true and GuiService.SelectedObject ~= nil then if inputObj.KeyCode == Enum.KeyCode.Thumbstick1 then local pos = inputObj.Position local xx = pos.X if (xx == 1 or xx == -1) then changeAngleOffset(45 * math.sign(xx)) end end end end)
I eventually decided to use UserInputService instead. That fixed the problem.