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

[SOLVED] Bound action functions do nothing?

Asked by 5 years ago
Edited 5 years ago
01function moveMenu(actionName, inputState, inputObj)
02    if inputState == Enum.UserInputState.Begin then
03        if GuiService.SelectedObject ~= nil then
04            if (inputObj.KeyCode == Enum.KeyCode.Left or inputObj.KeyCode == Enum.KeyCode.A) then
05                changeAngleOffset(-45)
06            elseif (inputObj.KeyCode == Enum.KeyCode.Right or inputObj.KeyCode == Enum.KeyCode.D) then
07                changeAngleOffset(45)
08            end
09 
10            selectSound:Play()
11        end
12    end
13end
14 
15function thumbstickMoveMenu(actionName, inputState, inputObj)
View all 25 lines...

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.

0
where do you bind them? have you tried print debugging? RiskoZoSlovenska 378 — 5y
0
Please notate the errors you are recieving and which lines are causing the problems. Also, have you tried debugging? RBLXNogin 187 — 5y
0
I'm not receiving any errors. It just... doesn't work for some reason BrockRocksYourSocks 48 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
01UserInputService.InputBegan:Connect(function(inputObj, processed)
02    if menuOpen == true and GuiService.SelectedObject ~= nil then
03        if (inputObj.KeyCode == Enum.KeyCode.Left or inputObj.KeyCode == Enum.KeyCode.A) then
04            changeAngleOffset(-45)
05        elseif (inputObj.KeyCode == Enum.KeyCode.Right or inputObj.KeyCode == Enum.KeyCode.D) then
06            changeAngleOffset(45)
07        end
08    end
09end)
10 
11UserInputService.InputChanged:Connect(function(inputObj, processed)
12    if menuOpen == true and GuiService.SelectedObject ~= nil then
13        if inputObj.KeyCode == Enum.KeyCode.Thumbstick1 then
14            local pos = inputObj.Position
15            local xx = pos.X
View all 22 lines...

I eventually decided to use UserInputService instead. That fixed the problem.

Ad

Answer this question