Skip to content

Class · inherits GuiObject

ViewportFrame

Official docs ↗

GuiObject that renders 3D objects inside its bounds.

About ViewportFrame

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

  • Ambient: Color3The lighting hue applied to the area within the ViewportFrame.

    This property determines the lighting hue applied to the area within the ViewportFrame. Defaults to Color3.fromRGB(200, 200, 200) (ghost grey).

  • CurrentCamera: CameraNotReplicatedCamera that is used to render children objects.

    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: Color3Determines how the rendered viewport image will be colorized.

    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: floatDetermines the transparency of the rendered viewport image.

    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: Color3The color of the emitted light.

    The color of the emitted light. Defaults to Color3.fromRGB(140, 140, 140) (silver).

  • LightDirection: Vector3A Vector3 representing the direction of the light source.

    A Vector3 representing the direction of the light source from position (0, 0, 0). Defaults to Vector3.new(-1, -1, -1).

ViewportFrame also has every member of GuiObject. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.