-
What do you want to achieve? I’m trying to make a sprint button on the game for mobile players, so I’m learning how to use the Context Action Service
-
What is the issue? Base on “Creating Mobile Buttons”, the fourth parameter of Context Action Ser. is the “InputTypes” or “the inputs you want to bind to the function, for instance enum values from
KeyCode
.”. But when I try printing out which button was pressed
local function handleAction(actionName, inputState, inputObject)
if inputState == Enum.UserInputState.Begin then
print(actionName, inputObject.KeyCode)
end
end
-- Bind action to function
contextaction:BindAction("Interact", handleAction, true, Enum.KeyCode.T)
(the script is from the article btw)
it outputs this
Interact Enum.KeyCode.Unknown - Client - BaseLocalScript:23
- What solutions have you tried so far? Tried researching more about it but still can’t find any solution
oh and btw while using the emulator I always keep getting these errors