ContextActionService default button not going away

I have a ContextActionService mobile button, but when I replace the image, the default button is still behind the new image. Along with this, the new image does not take up the full space available!

Before:
image

After:
image

As you can see, the default button is still behind the new button. I have no idea why this is the case. Here’s the code:

ContextActionService:BindAction("Sprint", shiftButtonInput, true, Enum.KeyCode.LeftShift, Enum.KeyCode.ButtonL2)
ContextActionService:SetPosition("Sprint", UDim2.new(0.5, 0, -0.15, 0))
ContextActionService:SetImage("Sprint", "rbxassetid://15076394718")
if UserInputService.TouchEnabled and not UserInputService.KeyboardEnabled and not UserInputService.GamepadEnabled then
	local button = ContextActionService:GetButton("Sprint")
	
	button.Size = UDim2.fromOffset(button.Size.X.Offset * 1.5, button.Size.Y.Offset * 1.5) 
end

Did you manage to fix this issue?

Kinda found a hacky way to accomplish it. I basically enlarged the image size and manually went into the button and made the default button invisible. It works now, you can test it on mobile in this game: Teddy Escape🧸 - Roblox

1 Like