Open Asterune
PrefabService

PrefabService

Creates and updates instances from reusable prefabs.

Service
game:GetService("PrefabService")
Inherits
Instance
Replication
Never

Behavior

PrefabService creates and updates instances from reusable prefabs.

Summary

Members10
Methods10

Methods

ClearOverride

PrefabService:ClearOverride(copy: Instance, path: string, property: string): ()

Removes a recorded local property override.

GetExecutionGroup

PrefabService:GetExecutionGroup(): ExecutionGroup?

Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.

GetOverrides

PrefabService:GetOverrides(copy: Instance): { PrefabOverrideInfo }

Returns the local overrides recorded for a prefab instance.

GetSource

PrefabService:GetSource(copy: Instance): Instance?

Returns the prefab source associated with an instance.

Instantiate

PrefabService:Instantiate(prefab: Instance, parent: Instance?): Instance

Creates an instance hierarchy from a prefab source.

PrefabService:Link(copy: Instance, prefab: Instance): ()

Associates an instance hierarchy with a prefab source.

SetOverride

PrefabService:SetOverride(copy: Instance, path: string, property: string, value: AttributeValue | EnumItem): ()

Records a local property override for a prefab instance.

Sync

PrefabService:Sync(copy: Instance): Instance

Updates a prefab instance from its source while applying its overrides.

SyncAll

PrefabService:SyncAll(): number

Updates linked prefab instances from their sources.

PrefabService:Unlink(copy: Instance): boolean

Removes the association between an instance hierarchy and its prefab source.

Inherited members

Inherited47

Instance