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
Removes a recorded local property override.
Returns this instance if it is an ExecutionGroup.
Returns the local overrides recorded for a prefab instance.
Returns the prefab source associated with an instance.
Creates an instance hierarchy from a prefab source.
Associates an instance hierarchy with a prefab source.
SetOverride(copy: Instance, path: string, property: string, value: AttributeValue | EnumItem): ()serial onlyRecords a local property override for a prefab instance.
Updates a prefab instance from its source while applying its overrides.
Updates linked prefab instances from their sources.
Removes the association between an instance hierarchy and its prefab source.
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
Returns the prefab source associated with an instance.
Instantiate
Creates an instance hierarchy from a prefab source.
Link
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
Updates a prefab instance from its source while applying its overrides.
SyncAll
PrefabService:SyncAll(): numberUpdates linked prefab instances from their sources.
Unlink
PrefabService:Unlink(copy: Instance): booleanRemoves the association between an instance hierarchy and its prefab source.
Inherited members
- Properties
- ArchivableClassNameNameParent
- Methods
- AddComponent()AddTag()ClearAllChildren()ClearTags()Clone()Destroy()FindFirstAncestor()FindFirstAncestorOfClass()FindFirstAncestorWhichIsA()FindFirstChild()FindFirstChildOfClass()FindFirstChildWhichIsA()FindFirstDescendant()GetAttribute()GetAttributeChangedSignal()GetAttributes()GetChildren()GetComponent()GetComponentChangedSignal()GetComponents()GetDebugId()GetDescendants()GetFullName()GetPropertyChangedSignal()GetReferencing()GetTags()HasComponent()HasTag()IsA()IsAncestorOf()IsDescendantOf()RemoveComponent()RemoveTag()SetAttribute()WaitForChild()
- Events
- AncestryChangedAttributeChangedChangedChildAddedChildRemovedDescendantAddedDescendantRemovingDestroying