Issue Type: Other
Impact: High
Frequency: Constantly
Date First Experienced: 2021-05-05 09:05:00 (-07:00)
The Issue
The AvatarContextMenu when enabled will sink all DPadUp InputStates regardless of the priority of other active ContextInputs (this is due to the Securities for both being different, one being Core and the other Developer). The main issue is that ALL InputStates are sunk rather than the one being used making the Input unusable.
The highlighted code shows the issues:
(ExtraContent/scripts/CoreScripts/CoreScripts/AvatarContextMenu.lua)
this should be changed so that it returns Enum.ContextActionResult.Pass rather than Sink. Additionally, :BindCoreAction should be changed to :BindAction so that developers can easily override it without having to use annoying workarounds.
Reproduction Steps:
-- Services
local StarterGui = game:GetService("StarterGui")
local ContextActions = game:GetService("ContextActionService")
-- Enable the AvatarContextMenu
StarterGui:SetCore("AvatarContextMenuEnabled", true)
-- Bind our action (priority doesn't matter here)
ContextActions:BindAction("DPadUpSinked", function(...)
print(...) -- This never happens because DPadUp is sunk by the AvatarContextMenu
end, false, Enum.KeyCode.DPadUp)
Running this code should enable the AvatarContextMenu and then any attempt to use the DPadUp binding will fail and will not execute the code passed.
Expected Behavior:
I expect for the inputs to respect the priorities set by the Developer and to be set at a Developer controlled priority level rather than the Core level - this allows Developers to easily bind DPadUp for GuiBound actions without having to use workarounds (setting the SelectedObject) that could’ve been avoided by adopting this.
Additionally, it’s expected that it doesn’t sink all input states and only the input states that it uses (in this case UserInputState.Begin)
Actual Behavior:
All input states for DPadUp are sunk due to it being registered at the Core Security level rather than the Developer Security level
Workaround:
The only work around for this is to set the SelectedObject of GuiService to anything so that it returns Enum.ContextActionResult.Pass rather than Sink.