Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Disabling Arrow Keys as Movement?

I am looking through the Default ControlScript (cause that's obviously where controls are handled) and I can't see to find where to edit to disable arrow keys from moving your character?

Any help?

1 answer

You should be able to find what you need in the function on line 48 in the KeyboardMovement module script.

These functions are then BindActionToInputTypes with the Enum.PlayerActions.CharacterForward for example.

You can edit the function to add a small check to remove the arrow movements:-

	local moveForwardFunc = function(actionName, inputState, inputObject)	
		print(actionName, inputState, inputObject.KeyCode)
		if inputObject.KeyCode == Enum.KeyCode.W then -- key check
			if inputState == Enum.UserInputState.Begin then
				forwardValue = -1
			elseif inputState == Enum.UserInputState.End then
				forwardValue = 0
			end
		end
		updateMovement(inputState)
	end

Hope this helps, also you can invert the players movement by changing the values.

This discussion is preserved as it was. New answers, comments, and votes are closed.