ViewportFrame¶
GuiObject that renders 3D objects inside its bounds.
Not implemented yet
3D viewports inside the GUI are not implemented.
Workaround: Render the model in the world and use a camera or SurfaceGui workaround.
Description¶
ViewportFrame is a GuiObject that renders 3D objects inside its
bounds, offering a way to display 3D objects in a 2D space like a
ScreenGui. This object has the following caveats:
-
No shadows or post-processing effects are rendered.
-
Material.Neon and Material.Glass materials render at the lowest quality.
-
Nested GuiObjects aren't supported.
-
By default, lighting inside a
ViewportFrameacts as if Lighting.EnvironmentSpecularScale and Lighting.EnvironmentDiffuseScale are both set to0, so properties that rely on these fields, such as SurfaceAppearance.MetalnessMap, may look different. -
This object can use a Sky child as a cubemap for reflections, in which case only the Sky object's six
Skybox[…]properties are used. Assuming these properties are valid, lighting inside theViewportFrameacts similarly to if Lighting.EnvironmentSpecularScale and Lighting.EnvironmentDiffuseScale are both set to1. For details, see here.
Inheritance¶
Object → Instance → GuiBase → GuiBase2d → GuiObject → ViewportFrame
Properties¶
| Member | Signature | Summary |
|---|---|---|
Ambient |
Ambient: Color3 |
The lighting hue applied to the area within the ViewportFrame. |
CameraCFrame |
CameraCFrame: CFrame |
— |
CameraFieldOfView |
CameraFieldOfView: float |
— |
CurrentCamera |
CurrentCamera: Camera |
Camera that is used to render children objects. |
ImageColor3 |
ImageColor3: Color3 |
Determines how the rendered viewport image will be colorized. |
ImageTransparency |
ImageTransparency: float |
Determines the transparency of the rendered viewport image. |
IsMirrored |
IsMirrored: bool |
— |
LightColor |
LightColor: Color3 |
The color of the emitted light. |
LightDirection |
LightDirection: Vector3 |
A Vector3 representing the direction of the light source. |
Methods¶
| Member | Signature | Summary |
|---|---|---|
CaptureSnapshotAsync |
ViewportFrame:CaptureSnapshotAsync(): ContentId |
— |
Roblox reference: ViewportFrame
Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.