Surface GUIs do not display inside a Viewport Frame

Reproduction Steps

1) In StarterGui, create a ScreenGui with a ViewportFrame
2) Add a camera to the ViewportFrame
3) Add a Part into the ViewportFrame
4) Add a SurfaceGui to the Part, set the Surface to Top, set the Adornee to the Part
5) Add a TextLabel or any other UI element and scale it to {1,1} so that it is readily visible. Set Text to “Hello World” and scale it to fit.

Expected Behavior

I should see the TextLabel rendered onto the Part.

Actual Behavior

Nothing is rendered to the part’s surfaces.

When the SurfaceGui is parented to the StarterGui / PlayerGui, the UI elements render to the part in the Workspace, but not onto the part in the ViewportFrame.

Uploading: viewportFrameBug.rbxl…

Issue Area: Engine
Issue Type: Display
Impact: High
Frequency: Constantly
Date First Experienced: 2023-01-03 00:01:00 (-05:00)
Date Last Experienced: 2023-01-04 00:01:00 (-05:00)

2 Likes

This is not a bug but an intentional limitation of ViewportFrames, it was likely implemented so Roblox wouldn’t have to worry about ViewportFrames rendering other ViewportFrames inside of them, but this also applies to other effects such as particles, etc.

If you ask me, that sounds like a behavior that should be limited to ViewportFrames, not all SurfaceGuis. If a Viewport is a descendant of another Viewport, then it doesn’t render content.

3 Likes

This still is intentional behaviour however and should be rephrased as a #feature-requests , there are different flows that Roblox takes depending on whether something is a missing feature or a bug.

3 Likes

While you are probably right that this is a feature request. I’m holding onto that this is a bug, as there is no documentation saying that this isn’t a supported behavior.

ViewportFrames say this :

A ViewportFrame is a type of GUI that can render 3D objects inside its bounds. This is a great way to display 3D objects/models in a 2D GUI space like a ScreenGui. At the moment, no shadow or post effects are available. Neon and Glass materials will be rendered on lowest quality.

It links to UI tutorials which say this :

A ViewportFrame is a frame that uses a camera to render 3D objects. This type of frame is a great way to display 3D objects and models in a 2D space, such as:

  • A minimap of your experience directly in the corner of a user’s screen.
  • Models of items in a menu.
  • Rotating objects that a character has equipped.

Similarly, there are no limitations spelled out in the SurfaceGui documentation either.

1 Like

Thanks for the report! We’ll follow up when we have an update for you.

2 Likes

I’m bumping this. We can render textures in viewport frames, so why can’t we render Surface GUI?
Just disable rendering viewport frames inside viewport frames.

A huge use case is variable text for the rendered 3D model.

2 Likes

Currently ViewportFrame only supports rendering 3D objects. Gui and effects might be supported in the future but it’s not in the plan now.

2 Likes