Class
ViewportFrame
GuiObject that renders 3D objects inside its bounds.
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.NeonandMaterial.Glassmaterials render at the lowest quality.Nested
GuiObjectsaren't supported.By default, lighting inside a
ViewportFrameacts as ifLighting.EnvironmentSpecularScaleandLighting.EnvironmentDiffuseScaleare both set to0, so properties that rely on these fields, such asSurfaceAppearance.MetalnessMap, may look different.This object can use a
Skychild as a cubemap for reflections, in which case only theSkyobject's sixSkybox[…]properties are used. Assuming these properties are valid, lighting inside theViewportFrameacts similarly to ifLighting.EnvironmentSpecularScaleandLighting.EnvironmentDiffuseScaleare both set to1. For details, see here.
Properties 6#
AmbientColor3 | The lighting hue applied to the area within the ViewportFrame.ReadSafe |
CurrentCameraCamera | Camera that is used to render children objects.ReadSafeNotReplicated |
ImageColor3Color3 | Determines how the rendered viewport image will be colorized.ReadSafe |
ImageTransparencyfloat | Determines the transparency of the rendered viewport image.ReadSafe |
LightColorColor3 | The color of the emitted light.ReadSafe |
LightDirectionVector3 | A Vector3 representing the direction of the light source.ReadSafe |
Ambient: Color3#
ReadSafe
This property determines the lighting hue applied to the area within the
ViewportFrame. Defaults to
Color3.fromRGB(200, 200, 200)
(ghost grey).
CurrentCamera: Camera#
NotReplicatedReadSafe
Camera instance that is used to render children objects. Defaults
to nil.
The Camera object does not replicate so the
ViewportFrame.CurrentCamera won't replicate either. When you set
this property, Camera.CFrame and Camera.FieldOfView will
be saved and replicate with the ViewportFrame internally so the client
can render the frame without a Camera object.
ImageColor3: Color3#
ReadSafe
This property determines how the rendered viewport image will be
colorized, allowing you to change the color without directly modifying the
rendered object. The default colorization value is Color3.new(1, 1, 1) (white) at which
no color modification occurs.
See also ImageTransparency which
determines the transparency of the rendered image.
ImageTransparency: float#
ReadSafe
This property determines the transparency of the rendered viewport image,
allowing you to change the transparency without directly modifying the
rendered object. A value of 0 (default) is completely opaque and a value
of 1 is completely transparent (invisible).
See also ImageColor3 which determines
how the rendered image will be colorized.
LightColor: Color3#
ReadSafe
The color of the emitted light. Defaults to
Color3.fromRGB(140, 140, 140)
(silver).
LightDirection: Vector3#
ReadSafe
A Vector3 representing the direction of the light source from
position (0, 0, 0). Defaults to
Vector3.new(-1, -1, -1).
Inherited members#
Inherited from GuiObject 51
Properties (30)
Active, AnchorPoint, AutomaticSize, BackgroundColor, BackgroundColor3, BackgroundTransparency, BorderColor, BorderColor3, BorderMode, BorderSizePixel, ClipsDescendants, Draggable, GuiState, InputSink, Interactable, LayoutOrder, NextSelectionDown, NextSelectionLeft, NextSelectionRight, NextSelectionUp, Position, Rotation, Selectable, SelectionImageObject, SelectionOrder, Size, SizeConstraint, Transparency, Visible, ZIndex
Methods (3)
Inherited from GuiBase2d 12
Properties (11)
AbsolutePosition, AbsoluteRotation, AbsoluteSize, AutoLocalize, Localize, RootLocalizationTable, SelectionBehaviorDown, SelectionBehaviorLeft, SelectionBehaviorRight, SelectionBehaviorUp, SelectionGroup
Events (1)
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild