15 min read

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

Deprecated

PhysicsService

Inherits from: Instance → Object

PhysicsService primarily contains methods for working with collision groups which define whether a set of parts may or may not collide with parts in other collision groups. You can register a collision group through RegisterCollisionGroup() and assign parts to it by setting those parts' CollisionGroup property to the name of the collision group.

Creating, deleting, and modifying collision relationships between collision groups is limited to server-side Scripts.

See Collision Filtering for usage details in Studio and within scripts.

Inherits from: Instance

Memory category: Instances

Tags: NotCreatable, Service

Deprecated: This service has been deprecated in favor of per-world collision group configuration through WorldRoot which should be used for collision group management. Existing PhysicsService calls will forward to Workspace.

Methods

NameType / ReturnsDescription
PhysicsService:CollisionGroupContainsPartbooleanReturns whether the part is in the collision group.
PhysicsService:CollisionGroupsAreCollidablebooleanReturns whether the two groups will collide.
PhysicsService:CollisionGroupSetCollidable()Sets the collision status between two groups.
PhysicsService:CreateCollisionGroupintCreates a new collision group with the given name, and returns the ID of the created group.
PhysicsService:GetCollisionGroupIdintReturns the ID of the collision group with the specified name.
PhysicsService:GetCollisionGroupNamestringReturns the name of the group with the corresponding ID.
PhysicsService:GetCollisionGroupsArrayReturns a table with info on all of the place's collision groups.
PhysicsService:GetMaxCollisionGroupsintReturns the maximum number of collision groups.
PhysicsService:GetRegisteredCollisionGroupsArrayReturns a table with info on all of the place's collision groups.
PhysicsService:IsCollisionGroupRegisteredbooleanChecks if a collision group is registered.
PhysicsService:RegisterCollisionGroup()Registers a new collision group with the given name.
PhysicsService:RemoveCollisionGroup()Removes the collision group with the given name.
PhysicsService:RenameCollisionGroup()Renames specified collision group.
PhysicsService:SetPartCollisionGroup()Sets the collision group of a part.
PhysicsService:UnregisterCollisionGroup()Unregisters the collision group for the given name.

Inherited from Instance

NameType / ReturnsDescription
Instance:AddTag()Applies a tag to the instance.
Instance:childrenInstancesReturns an array of the object's children.
Instance:ClearAllChildren()This method destroys all of an instance's children.
Instance:CloneInstanceCreate a copy of an instance and all its descendants, ignoring instances that are not Archivable.
Instance:cloneInstance
Instance:Destroy()Sets the Instance.Parent property to nil, locks the Instance.Parent property, disconnects all connections, and calls Destroy() on all children.
Instance:destroy()
Instance:FindFirstAncestorInstance?Returns the first ancestor of the Instance whose Instance.Name is equal to the given name.
Instance:FindFirstAncestorOfClassInstance?Returns the first ancestor of the Instance whose Object.ClassName is equal to the given className.
Instance:FindFirstAncestorWhichIsAInstance?Returns the first ancestor of the Instance for whom Object:IsA() returns true for the given className.
Instance:FindFirstChildInstance?Returns the first child of the Instance found with the given name.
Instance:findFirstChildInstance
Instance:FindFirstChildOfClassInstance?Returns the first child of the Instance whose ClassName is equal to the given class name.
Instance:FindFirstChildWhichIsAInstance?Returns the first child of the Instance for whom Object:IsA() returns true for the given className.
Instance:FindFirstDescendantInstance?Returns the first descendant found with the given Instance.Name.
Instance:GetActorActor?Returns the Actor associated with the Instance, if any.
Instance:GetAttributeVariantReturns the value which has been assigned to the given attribute name.
Instance:GetAttributeChangedSignalRBXScriptSignalReturns an event that fires when the given attribute changes.
Instance:GetAttributesDictionaryReturns a dictionary of the instance's attributes.
Instance:GetChildrenInstancesReturns an array containing all of the instance's children.
Instance:getChildrenInstances
Instance:GetDebugIdstringReturns a coded string of the debug ID used internally by Roblox.
Instance:GetDescendantsInstancesReturns an array containing all of the descendants of the instance.
Instance:GetFullNamestringReturns a string describing the instance's ancestry.
Instance:GetStyledVariantReturns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified.
Instance:GetStyledPropertyChangedSignalRBXScriptSignalReturns an event that fires when the given style property changes on the instance.
Instance:GetTagsArrayGets an array of all tags applied to the instance.
Instance:HasTagbooleanCheck whether the instance has a given tag.
Instance:IsAncestorOfbooleanReturns true if an Instance is an ancestor of the given descendant.
Instance:IsDescendantOfbooleanReturns true if an Instance is a descendant of the given ancestor.
Instance:isDescendantOfboolean
Instance:IsPropertyModifiedbooleanReturns true if the value stored in the specified property is not equal to the code-instantiated default.
Instance:QueryDescendantsInstancesReturns an array containing all descendants of the instance that match the selector string.
Instance:Remove()Sets the object's Parent to nil, and does the same for all its descendants.
Instance:remove()
Instance:RemoveTag()Removes a tag from the instance.
Instance:ResetPropertyToDefault()Resets a property to its default value.
Instance:SetAttribute()Sets the attribute with the given name to the given value.
Instance:WaitForChildInstanceReturns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does.

Inherited from Object

NameType / ReturnsDescription
Object:GetPropertyChangedSignalRBXScriptSignalGet an event that fires when a given property of the object changes.
Object:IsAbooleanReturns true if an object's class matches or inherits from a given class.
Object:isAboolean

PhysicsService:CollisionGroupContainsPart

Deprecated. This method has been deprecated. It's recommended that you query a part's collision group through its CollisionGroup property.

Returns whether the specified part is in the specified collision group. This method will throw a runtime error in the following circumstances:

Parameters

NameTypeDefaultDescription
namestringThe name of the collision group to check.
partBasePartThe BasePart to check for membership in the collision group.

Returns

TypeDescription
booleantrue if the part belongs to the specified collision group, false otherwise.
FieldValue
tags["Deprecated"]
securityNone
thread safetyUnsafe
capabilities["Physics"]

PhysicsService:CollisionGroupsAreCollidable

Deprecated. This method has been superseded by WorldRoot:CollisionGroupsAreCollidable() which should be used for all new work.

Returns whether the two specified collision groups will collide. This method will also return true if either of the groups are unregistered, as the default collision mask collides with all groups.

Parameters

NameTypeDefaultDescription
name1stringThe name of the first collision group.
name2stringThe name of the second collision group.

Returns

TypeDescription
booleantrue if the two groups are set to collide, false otherwise. Also returns true if either group is unregistered.
FieldValue
securityNone
thread safetyUnsafe
capabilities["Physics"]
simulationAccesstrue

PhysicsService:CollisionGroupSetCollidable

Deprecated. This method has been superseded by WorldRoot:CollisionGroupSetCollidable() which should be used for all new work.

Sets the collision status between two groups. This method will throw an error if either of the groups is unregistered, so it's recommended that you confirm each group's registration through PhysicsService:IsCollisionGroupRegistered() before making this call.

Parameters

NameTypeDefaultDescription
name1stringThe name of the first collision group.
name2stringThe name of the second collision group.
collidablebooleanWhether the two groups should collide with each other.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Physics"]
simulationAccesstrue

PhysicsService:CreateCollisionGroup

Deprecated. This method has been superseded by RegisterCollisionGroup() which should be used for all new work.

Creates a new collision group with the given name, and returns the ID of the created group.

Parameters

NameTypeDefaultDescription
namestringThe name of the new collision group to create.

Returns

TypeDescription
intThe integer ID assigned to the newly created collision group.
FieldValue
tags["Deprecated"]
securityNone
thread safetyUnsafe
capabilities["Physics"]

PhysicsService:GetCollisionGroupId

Deprecated. This method has been deprecated. It's recommended that you query collision groups by name through a part's CollisionGroup property.

This method returns the ID of the collision group with the specified name. It will throw an error if no group with the given name exists.

Parameters

NameTypeDefaultDescription
namestringThe name of the collision group being retrieved.

Returns

TypeDescription
intThe ID of the retrieved collision group, or nil if no such group exists.
FieldValue
tags["Deprecated"]
securityNone
thread safetyUnsafe
capabilities["Physics"]

PhysicsService:GetCollisionGroupName

Deprecated. This method has been deprecated. It's recommended that you query collision groups by name through a part's CollisionGroup property.

Returns the name of the collision group with the corresponding ID, or an empty string if that ID (0–31) has not been assigned to a group. The method throws an error if the ID is outside the valid range.

Parameters

NameTypeDefaultDescription
nameintThe integer ID of the collision group to look up.

Returns

TypeDescription
stringThe name of the collision group with the given ID, or an empty string if the ID has not been assigned to a group.
FieldValue
tags["Deprecated"]
securityNone
thread safetyUnsafe
capabilities["Physics"]

PhysicsService:GetCollisionGroups

Deprecated. This method has been superseded by GetRegisteredCollisionGroups() which should be used for all new work.

Returns a table with info on all of the place's collision groups. Each value in the returned table is itself a table containing three members:

Member Type Description
id integer The ID of the group.
mask integer The collision group's mask; only for internal use.
name string The name of the collision group.

Returns

TypeDescription
ArrayAn array of tables, each containing name (string), id (integer), and mask (integer) fields for a registered collision group.
FieldValue
tags["Deprecated"]
securityNone
thread safetyUnsafe
capabilities["Physics"]

PhysicsService:GetMaxCollisionGroups

Deprecated. This method has been superseded by WorldRoot:GetMaxCollisionGroups() which should be used for all new work.

Returns the maximum number of collision groups the engine supports. This value is currently 32.

Returns

TypeDescription
intThe maximum number of collision groups supported, currently 32.
FieldValue
securityNone
thread safetyUnsafe
capabilities["Physics"]
simulationAccesstrue

PhysicsService:GetRegisteredCollisionGroups

Deprecated. This method has been superseded by WorldRoot:GetRegisteredCollisionGroups() which should be used for all new work.

Returns a table with info on all of the place's collision groups. Each value in the returned table is itself a table and containing two members:

Member Type Description
mask integer The collision group's mask; only for internal use.
name string Name of the collision group.

Returns

TypeDescription
ArrayAn array of tables, each containing name (string) and mask (integer) fields for a registered collision group.
FieldValue
securityNone
thread safetyUnsafe
capabilities["Physics"]
simulationAccesstrue

PhysicsService:IsCollisionGroupRegistered

Deprecated. This method has been superseded by WorldRoot:IsCollisionGroupRegistered() which should be used for all new work.

Checks if a collision group is registered. It's recommended that you call this method before calling methods that throw errors for unregistered collision groups, such as PhysicsService:CollisionGroupSetCollidable().

Parameters

NameTypeDefaultDescription
namestringThe name of the collision group to check.

Returns

TypeDescription
booleantrue if a collision group with the given name is registered, false otherwise.
FieldValue
securityNone
thread safetyUnsafe
capabilities["Physics"]
simulationAccesstrue

PhysicsService:RegisterCollisionGroup

Deprecated. This method has been superseded by WorldRoot:RegisterCollisionGroup() which should be used for all new work.

Registers a new collision group with the given name. The name cannot be "Default".

Note that this method has a slight performance overhead based on the number of BaseParts in the workspace, so it's recommended that you register all collision groups at edit time through the Studio editor and call UnregisterCollisionGroup() and RenameCollisionGroup() as infrequently as possible.

Parameters

NameTypeDefaultDescription
namestringThe name of the collision group to register.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Physics"]
simulationAccesstrue

Code samples: View on Creator Hub (PhysicsService-RegisterCollisionGroup).

PhysicsService:RemoveCollisionGroup

Deprecated. This method has been superseded by UnregisterCollisionGroup() which should be used for all new work.

Removes the collision group with the given name. If an invalid name is provided, this method will not do anything, although if the reserved name "Default" is provided, it will throw an error. If there are any parts in the collision group when it is removed, these parts will still maintain the same collision group ID. The physical behavior of parts in a removed group is undefined, so it is recommended to move any parts in a removed group to another group. This method will throw a runtime error in the following circumstances:

Parameters

NameTypeDefaultDescription
namestringThe name of the collision group to remove.

Returns

TypeDescription
()
FieldValue
tags["Deprecated"]
securityNone
thread safetyUnsafe
capabilities["Physics"]

PhysicsService:RenameCollisionGroup

Deprecated. This method has been superseded by WorldRoot:RenameCollisionGroup() which should be used for all new work.

Renames the specified registered collision group, but does not rename the CollisionGroup property of parts that utilize the group. The first argument of this method is the name of the group to rename, the second argument is the new name for the group. If the specified group does not exist, this method will not do anything. The naming conventions for the new name follow the same rules as if the group was being created with RegisterCollisionGroup().

This method will throw a runtime error in the following circumstances:

Note that this method has a slight performance overhead based on the number of BaseParts in the workspace, so it's recommended that you register all collision groups at edit time through the Studio editor and rename them as infrequently as possible.

Parameters

NameTypeDefaultDescription
fromstringThe current name of the collision group to rename.
tostringThe new name for the collision group.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Physics"]
simulationAccesstrue

PhysicsService:SetPartCollisionGroup

Deprecated. This method has been deprecated. It's recommended that you set a part's collision group by name through its CollisionGroup property.

This method sets the collision group of the specified part to the group with the specified name. It is equivalent to setting the BasePart.CollisionGroupId, although calling this method is the recommended approach.

This method will throw a runtime error in the following circumstances:

Parameters

NameTypeDefaultDescription
partBasePartThe part being set.
namestringThe name of collision group that the part's collision group is being set to.

Returns

TypeDescription
()
FieldValue
tags["Deprecated"]
securityNone
thread safetyUnsafe
capabilities["Physics"]

PhysicsService:UnregisterCollisionGroup

Deprecated. This method has been superseded by WorldRoot:UnregisterCollisionGroup() which should be used for all new work.

Unregisters the collision group for the given name, with the following behaviors:

Note that this method has a slight performance overhead based on the number of BaseParts in the workspace, so it's recommended that you register all collision groups at edit time through the Studio editor and call this method as infrequently as possible.

Parameters

NameTypeDefaultDescription
namestringThe name of the collision group to unregister.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Physics"]
simulationAccesstrue

Properties

Inherited from Instance

NameType / ReturnsDescription
Instance.ArchivablebooleanDetermines if an Instance and its descendants can be cloned using Instance:Clone(), and can be saved/published.
Instance.archivableboolean
Instance.CapabilitiesSecurityCapabilitiesThe set of capabilities allowed to be used for scripts inside this container.
Instance.IsInSandboxbooleanIndicates whether the instance is inside a sandboxed container.
Instance.NamestringA non-unique identifier of the Instance.
Instance.ParentInstanceDetermines the hierarchical parent of the Instance.
Instance.PredictionModePredictionModeReflects the client-side prediction mode applied to the instance under server-authoritative physics.
Instance.RobloxLockedbooleanA deprecated property that used to protect CoreGui objects.
Instance.SandboxedbooleanWhen enabled, the instance can only access abilities in its Capabilities list.
Instance.UniqueIdUniqueIdA unique identifier for the instance.

Inherited from Object

NameType / ReturnsDescription
Object.ClassNamestringA read-only string representing the class this Object belongs to.
Object.classNamestring

Events

Inherited from Instance

NameType / ReturnsDescription
Instance.AncestryChangedFires when the Instance.Parent property of this object or one of its ancestors is changed.
Instance.AttributeChangedFires whenever an attribute is changed on the Instance.
Instance.ChildAddedFires after an object is parented to this Instance.
Instance.childAdded
Instance.ChildRemovedFires after a child is removed from this Instance.
Instance.DescendantAddedFires after a descendant is added to the Instance.
Instance.DescendantRemovingFires immediately before a descendant of the Instance is removed.
Instance.DestroyingFires immediately before (or is deferred until after) the instance is destroyed via Instance:Destroy().
Instance.StyledPropertiesChangedFires whenever any style property is changed on the instance, including when a property is set to nil.

Inherited from Object

NameType / ReturnsDescription
Object.ChangedFires immediately after a property of the object changes, with some limitations.