ContextActionService buttons broken/misplaced on Device Emulator

Upon using the device emulator to test any mobile / tablet device, buttons created using ContextActionService are misplaced, and changes to any of their properties using ContextActionService:GetButton() are ignored.

This only occurs on PlaySolo, and works without any issues in-game, making testing mobile UI on studio frustrating.
before it was rolled out to everyone, this only ocurred when the “Faster Play Solo” feature was enabled.

to reproduce:

  • create a new empty baseplate
  • create a button with contextactionservice
  • resize or position this button utilizing :GetButton()
  • use device emulator for any mobile device or tablet, and play solo

image

see open-sourced place file of an empty baseplate with a reset button to reproduce the bug:

No Beta features enabled

possibly related:

2 Likes

Thanks for the report! I filed a ticket in our internal database and we’ll follow up when we have an update for you.

3 Likes

Thank you for the bug report. We’ve been able to reproduce the problem and are preparing a fix, which will ship in a future version of Studio.

This was indeed caused by Faster Play Solo, which changed the ordering of certain loading events and ended up breaking the ContextActionService:GetButton API in Play Solo mode for the first frame. Essentially, when user scripts first run a specific resource needed for this API hasn’t loaded yet. As a temporary workaround, adding a task.wait(1/60) to your script prior to calling the GetButton API should dodge the load order problem.

2 Likes