How to disable movement using arrow keys but still allow UIS to detect arrow keys?

I have a GUI which you can switch options in the gui using the arrow keys. But whenever I do, the player moves which I don’t want. How do I fix this?

1 Like

This code below disables the arrow keys from moving the character

local ContextActionService = game:GetService("ContextActionService")

ContextActionService:BindActionAtPriority("DisableArrowKeys", function()
	return Enum.ContextActionResult.Sink
end, false, Enum.ContextActionPriority.High.Value, Enum.KeyCode.Up, Enum.KeyCode.Down, Enum.KeyCode.Left, Enum.KeyCode.Right)
1 Like

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