Reference API Roblox

Engine API

Website

Related

Reference API Roblox

ViewportFrame

GuiObject that renders 3D objects inside its bounds.

Member index 10

HistoryMember
731Ambient: Color3
731CurrentCamera: Camera
731ImageColor3: Color3
731ImageTransparency: float
731LightColor: Color3
731LightDirection: Vector3
645CaptureSnapshotAsync(): ContentId
inherited from GuiObject
731Active: bool
731AnchorPoint: Vector2
731AutomaticSize: AutomaticSize
731BackgroundColor3: Color3
731BackgroundTransparency: float
731BorderColor3: Color3
731BorderMode: BorderMode
731BorderSizePixel: int
731ClipsDescendants: bool
731Draggable: bool
731GuiState: GuiState
731InputSink: InputSink
731Interactable: bool
731LayoutOrder: int
731NextSelectionDown: GuiObject
731NextSelectionLeft: GuiObject
731NextSelectionRight: GuiObject
731NextSelectionUp: GuiObject
731Position: UDim2
731Rotation: float
731Selectable: bool
731SelectionImageObject: GuiObject
731SelectionOrder: int
731Size: UDim2
731SizeConstraint: SizeConstraint
731Visible: bool
731ZIndex: int
462TweenPosition(endPosition: UDim2, easingDirection: EasingDirection = Out, easingStyle: EasingStyle = Quad, time: float = 1, override: bool = false, callback: Function = nil): bool
713TweenPositionInternal(endPosition: UDim2, easingDirection: EasingDirection = Out, easingStyle: EasingStyle = Quad, time: float = 1, override: bool = false, callback: Function = nil): bool
462TweenSize(endSize: UDim2, easingDirection: EasingDirection = Out, easingStyle: EasingStyle = Quad, time: float = 1, override: bool = false, callback: Function = nil): bool
462TweenSizeAndPosition(endSize: UDim2, endPosition: UDim2, easingDirection: EasingDirection = Out, easingStyle: EasingStyle = Quad, time: float = 1, override: bool = false, callback: Function = nil): bool
713TweenSizeAndPositionInternal(endSize: UDim2, endPosition: UDim2, easingDirection: EasingDirection = Out, easingStyle: EasingStyle = Quad, time: float = 1, override: bool = false, callback: Function = nil): bool
713TweenSizeInternal(endSize: UDim2, easingDirection: EasingDirection = Out, easingStyle: EasingStyle = Quad, time: float = 1, override: bool = false, callback: Function = nil): bool
462DragBegin(initialPosition: UDim2)
462DragStopped(x: int, y: int)
483InputBegan(input: InputObject)
483InputChanged(input: InputObject)
483InputEnded(input: InputObject)
462MouseEnter(x: int, y: int)
462MouseLeave(x: int, y: int)
462MouseMoved(x: int, y: int)
462MouseWheelBackward(x: int, y: int)
462MouseWheelForward(x: int, y: int)
462SelectionGained()
462SelectionLost()
462TouchLongPress(touchPositions: Array, state: UserInputState)
462TouchPan(touchPositions: Array, totalTranslation: Vector2, velocity: Vector2, state: UserInputState)
462TouchPinch(touchPositions: Array, scale: float, velocity: float, state: UserInputState)
462TouchRotate(touchPositions: Array, rotation: float, velocity: float, state: UserInputState)
462TouchSwipe(swipeDirection: SwipeDirection, numberOfTouches: int)
462TouchTap(touchPositions: Array)
inherited from GuiBase2d
731AbsolutePosition: Vector2
731AbsoluteRotation: float
731AbsoluteSize: Vector2
731AutoLocalize: bool
731RootLocalizationTable: LocalizationTable
731SelectionBehaviorDown: SelectionBehavior
731SelectionBehaviorLeft: SelectionBehavior
731SelectionBehaviorRight: SelectionBehavior
731SelectionBehaviorUp: SelectionBehavior
731SelectionGroup: bool
525SelectionChanged(amISelected: bool, previousSelection: GuiObject, newSelection: GuiObject)
inherited from Instance
731Archivable: bool
731Capabilities: SecurityCapabilities
731IsInSandbox: bool
731Name: string
731Parent: Instance
731PredictionMode: PredictionMode
731Sandboxed: bool
731UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
731children(): Instances
731clone(): Instance
731destroy(): null
731findFirstChild(name: string, recursive: bool = false): Instance
731getChildren(): Instances
731isDescendantOf(ancestor: Instance): bool
731remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
731childAdded(child: Instance)
inherited from Object
731ClassName: string
731className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
731isA(className: string): bool
647Changed(property: string)

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:

History 54

Members 10

Ambient

TypeDefault
Color30.784314, 0.784314, 0.784314

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

History 6

CaptureSnapshotAsync

Parameters (0)
No parameters.
Returns (1)
ContentId
This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

CurrentCamera

TypeDefault
Camera

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.

This property is not replicated. Its interface does not cross the network boundary.

History 8

Tags: [NotReplicated]

ImageColor3

TypeDefault
Color31, 1, 1

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.

History 6

ImageTransparency

TypeDefault
float0

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.

History 6

LightColor

TypeDefault
Color30.54902, 0.54902, 0.54902

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

History 6

LightDirection

TypeDefault
Vector3-1, -1, -1

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

History 6

Settings