Button not being positioned correctly

I’m working on making my game more mobile-friendly using the ContextActionService | Roblox Creator Documentation, however, I’m having some trouble with the :SetPosition function. Every time I attempt to set the position to (0.75, -95, 0.2, 75), it ends up being positioned to (0, 123, 0, 70).

Here’s my current code:

local function actionHandler(_, inputState, inputObject)
	if inputState == Enum.UserInputState.Begin then
		copy.Callback(copy, inputObject);
	end;
end;

ContextActionService:BindAction(Binder, actionHandler, true, Enum.KeyCode.F);
ContextActionService:SetPosition(Binder, UDim2.new(0.75, -95, 0.2, 75));

Take off the -95, that’s an offset.

Just tried it and it didn’t work, so I tried a couple of other random positions, but it keeps positioning to the same spot every single time. I also tried:

ContextActionService:GetButton(Binder).Position = UDim2.new(0.75, -95, 0.2, 75)

And nothing happened, no errors or anything.

I forgot to tell you, try taking off both the -95 and the 75.

same problem 3 years later, any solutions?

From what I remember, I believe I just put the button in a position where it was off the screen. Not sure if that’s what’s happening in your case though :person_shrugging: