Roblox UtilitiesDevlHub Roblox Documentation

Class

ViewportFrame

Inherits
GuiObject › GuiBase2d › GuiBase › Instance › Object
Memory category
Gui

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:

Properties 6#

AmbientColor3The lighting hue applied to the area within the ViewportFrame.ReadSafe
CurrentCameraCameraCamera that is used to render children objects.ReadSafeNotReplicated
ImageColor3Color3Determines how the rendered viewport image will be colorized.ReadSafe
ImageTransparencyfloatDetermines the transparency of the rendered viewport image.ReadSafe
LightColorColor3The color of the emitted light.ReadSafe
LightDirectionVector3A 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
Inherited from GuiBase2d 12
Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed