Setting SelectedObject to "non playergui" object causes a crash!

Behavior when setting GuiService’s SelectedObject is normal and works as it should when supplying an object within the PlayerGui. However, setting it to an object (On a BillboardGui from my testing) say in Workspace, causes an instant client crash. (Studio and online)

This bug happens 100% of the time from what I have tested and is effecting both studio and client. I have attached a simple place file and some code below to run and reproduce the issue. The safe code runs fine and works as it should, the crash code that sets the SelectionObject to something in the workspace crashes the client instantly.

rep.rbxl (12.7 KB)

Safe Code: game.GuiService.SelectedObject = game.Players.LocalPlayer.PlayerGui.ScreenGui.TextButton
Crash Code: game.GuiService.SelectedObject = game.Workspace.Baseplate.SurfaceGui.TextButton

This started happening some time ago, I was reported it was effecting my game on or possibly before April 15th, but since I have been so busy, I only just now got around to checking it out. (I originally thought it was just his PC having issues with it and it would work fine for me)

f97796d106a1c1af8d3d7620487796cf3bf44ca4.jpg

Hopefully this can get fixed soon. I spent HOURS going through my code debugging trying to figure out what was causing it only to figure out it was this tiny little thing causing a huge huge headache. :frowning:

Definitely shouldn’t crash! I’ve figured out why this happens, I’ll fix it soon.

EDIT: Fix is now in review. It will go out some time around May 17th if all goes well.

1 Like

I believe this is fixed now. Thanks for the report.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.