UserInputType.End does not exsist

Hello I’m using Context Action Service and I’m trying to find out if the object is “End” or “Cancel.” Only problem is it says end and cancel does not exsist. Even though when I print “inputState” it prints out as “Enum.UserInputType.End.”
Error: End is not a valid member of "Enum.UserInputType"
Script:

local function findDirection(name, inputState, input)
	if UserInputService.MouseBehavior == Enum.MouseBehavior.LockCenter then
		if name == "Forward" and inputState == Enum.UserInputType.End then

		elseif name == "Backward" and inputState == Enum.UserInputType.End  then

		end
		if name == "Left" and inputState == Enum.UserInputType.End  then
			
		elseif name == "Right" and inputState == Enum.UserInputType.End  then
			
	end
end

ContextActionService:BindAction("Left", findDirection, false, Enum.PlayerActions.CharacterLeft)
ContextActionService:BindAction("Right", findDirection, false, Enum.PlayerActions.CharacterRight)
ContextActionService:BindAction("Forward", findDirection, false, Enum.PlayerActions.CharacterForward)
ContextActionService:BindAction("Backward", findDirection, false, Enum.PlayerActions.CharacterBackward)

Thank you.

Change Enum.UserInputType.End to Enum.UserInputState.End

1 Like

I guess I’m just blind haha. Thank you.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.