SurfaceGui not showing in Viewport Frame

Hi,
I want to create a GUI with buttons represented by ViewportFrames showing my models (parts with texts). I placed this script inside a transparent button.
Almost everything works perfectly however I can not see SurfaceGui with TextLabel. I see only a part but the text in TextLabel is not visible. The output shows no errors and child SurfaceGui and TextLabel are available. If I place the part in the workspace it is displayed correctly. So I suppose it is a problem o ViewportFrame with inner SurfaceGui. Could you help me, please?

Script:

local viewportFrame = script.Parent.ViewportFrame

local part = game.ReplicatedStorage.Stickers.BigText:Clone()
part.SurfaceGui.TextLabel.Text = "abc"
part.Position = Vector3.new(0, 0, 0)
part.Orientation = Vector3.new(-5, 15, 0)
part.Parent = viewportFrame

local viewportCamera = Instance.new("Camera")
viewportFrame.CurrentCamera = viewportCamera
viewportCamera.Parent = viewportFrame
viewportCamera.CFrame = CFrame.new(Vector3.new(0, 0, 10), part.Position)

surfaceguis dont at all show in the viewport frame world so better luck next time.

1 Like

Oh… and don’t you know how to fix it?

there isnt any fix (there might be but idk about any) to it either make a custom engine or just dont do that and do something else!

oh, and don’t you know about any other way how to show the text on the part?
with using a viewport frame?

i suppose you can use maths and textlabels to do that but no.

okay, thanks for your little help I will try to do something with it! (:

surface GUIs don’t render in viewports and it’s currently impossible to make render

1 Like

am sad about that information but thanks for your reply!

and the decal works on viewportframe?

I wouldnt say impossible but yea impossible to render but to achieve what original poster says is you can use some maths to size and position a textlabel knowing it wont give that 3d effect but still close and if you want to make it quite accurate you can either use 3d text or make your own rendering system.

yea the 3d text will be great! thanks

you could also cast rays when clicking and checking magnitud and the hit face

Sorry, but this is one of the instances that do not render in ViewportFrames. The other ones I can think of are:

  • ParticleEmitter
  • Trail
  • Beam
  • BillboardGui
  • Certain Materials
  • Lighting Effects

In what way are you trying to use this surfacegui? Maybe there’s an alternative?

am using the text label. i will use the 3d text i think

Could you show your UI or whatever it is your trying to make? There’s probably an alternative which looks and works better.

put the SurfaceGui to StarterGui and set it’s adornee to the part you want

It won’t render in the viewportframe tho, that’s what he wants.

1 Like