When your SurfaceGui isn’t showing up on its adornee #RobloxDev

So this might be a problem only I have because I am a weirdo but … just in case.
I was running a script where I:

  1. Cloned a model
  2. Passed the cloned model through to a function to do some stuff to it, including:
  3. Cloned a SurfaceGui
  4. Assigned the SurfaceGui parent to the PlayerGui
  5. Set the SurfaceGui Adornee to one of the pieces in my cloned model
  6. Parented the model in the workspace

The problem was, my GUI was not showing on the model. The cloned gui was in my player.PlayerGui, and the Adornee was assigned, but it was invisible.
I checked if it was enabled, I checked if all the elements were visible .. nothing.
And then I realized that the model’s parent was set AFTER the adornee was being assigned to the part in the model.
When I gave the model a parent in the workspace and THEN assigned the Adornee, all was well. I am left to assume I shouldn’t be assigning adornees in models outside the workspace.

So: if you’re assigning a SurfaceGui adornee to a model without a parent, try parenting the model first.

Leave a Reply

Your email address will not be published. Required fields are marked *