Needing help with ContextActionService:SetPosition()

EDIT: I’ve already found a solution of my own to this problem. Thanks to everyone who tried to help in the comments.

I’ve been trying to add mobile support for my game, and after learning how to use ContextActionService for it, I’ve finally did it.

The buttons work like they should, but I have a problem with their positions. This is an example of what I’m struggling with:
image
For example, I have the reference text button here.
image
This is its current position.
image
The script has the correct coordinates.
But in-game, it looks like this:
image
As you can see, the button goes to the wrong coordinates. My guess is that ContextActionService has its own area for the buttons that isn’t the entire size of the screen, but if it does, then what exactly is the size of that area, and where is it located?

This is basically what I need help with. Other than this, the buttons work perfectly. Any help?

2 Likes

Limitations of this service, if you really want the button there, make your own button and to detect it use .TouchTap.

Thanks for the info, I’ll try using this.

You could also scale the position in negative, but the button moves a little and if it is an image you will not be able to scale it so that it does not stretch and the circle of this service is really ugly xd

Yep like @SOTR654 said it’s a limitation as it’s relative to a frame in core scripts.

To solve this I believe you can try using get button to modify the gui directly.

Hello Vince666YT, You need to add a UIAspectRatio constraints to adjust the gui as the size of the screen. You can use that plugin to do it for you : AutoScale Lite - Roblox