2 min read

Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.

Instance

The Instance data type holds constructors for Instance objects.

Constructors

NameType / ReturnsDescription
Instance.newReturns an Instance of the specified class.
Instance.fromExistingReturns an Instance which is a copy of an existing Instance.

Instance.new

Creates a new Instance of type className. Abstract classes and services cannot be created with this constructor.

Note that when the Parent of an object is set, Luau listens to a variety of different property changes for replication, rendering, and physics. For performance reasons, it's recommended to set the instance's Parent property last when creating new objects, instead of specifying the second argument (parent) of this constructor.

local Workspace = game:GetService("Workspace")

-- Set new instance's parent last (recommended)
local part = Instance.new("Part")
part.Position = Vector3.new(0, 10, 0)
part.Parent = Workspace

-- Set new instance's parent in constructor (discouraged)
local part = Instance.new("Part", Workspace)
part.Position = Vector3.new(0, 10, 0)

Parameters

NameTypeDefaultDescription
classNamestringClass name of the new instance to create.
parentInstance?Optional object to parent the new instance to. Not recommended for performance reasons (see description above).

Instance.fromExisting

Creates a new object with the same type and property values as an existing object. In most cases using Instance:Clone() is more appropriate, but this constructor is useful when implementing low‑level libraries or systems.

There are two behavioral differences between this constructor and the Instance:Clone() method:

Parameters

NameTypeDefaultDescription
existingInstanceInstanceThe existing Instance to copy property values from.