How do I detect if the player lets go of the key/mobile button using context action service?
ContextActionService should call the function you’ve binded when input ends. When it calls the function, it passes 3 arguments: actionName, inputState,
and inputObject
. Check that InputState == Enum.UserInputState.End as that’s when the player let go of the button.
1 Like
This is correct, here’s some code to go along with it just in case you need it!
local function doAction(actionName, inputState, inputObject)
if actionName == "actionA" and inputState == Enum.UserInputState.End then
print("Action ended!")
end
end