Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
GeometryService
Inherits from: Instance → Object
Service containing geometric operations not directly related to specific objects.
Inherits from: Instance
Memory category: Instances
Tags: NotCreatable, Service
Methods
| Name | Type / Returns | Description |
|---|---|---|
| GeometryService:CalculateConstraintsToPreserve | Array | Returns a table of Constraints and Attachments which you may choose to preserve, along with their respective parents. |
| GeometryService:FragmentAsync | Array | Breaks a BasePart into multiple MeshPart instances, according to the pattern of points passed in, by using voronoi decomposition. |
| GeometryService:GenerateFragmentSites | Array | Provides an array of positions which can easily be passed into FragmentAsync to perform simple types of destruction. |
| GeometryService:IntersectAsync | Array | Creates one or more PartOperations or MeshParts from the intersecting geometry of multiple parts. |
| GeometryService:SubtractAsync | Array | Creates one or more PartOperations or MeshParts from one part minus the space occupied by other parts. |
| GeometryService:SweepPartAsync | MeshPart | Creates a MeshPart which has the shape of the input part stretched/dragged through the given set of CFrame positions. |
| GeometryService:UnionAsync | Array | Creates one or more PartOperations or MeshParts from one part plus the space occupied by other parts. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance:AddTag | () | Applies a tag to the instance. |
| Instance:children | Instances | Returns an array of the object's children. |
| Instance:ClearAllChildren | () | This method destroys all of an instance's children. |
| Instance:Clone | Instance | Create a copy of an instance and all its descendants, ignoring instances that are not Archivable. |
| Instance:clone | Instance | |
| 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:FindFirstAncestor | Instance? | Returns the first ancestor of the Instance whose Instance.Name is equal to the given name. |
| Instance:FindFirstAncestorOfClass | Instance? | Returns the first ancestor of the Instance whose Object.ClassName is equal to the given className. |
| Instance:FindFirstAncestorWhichIsA | Instance? | Returns the first ancestor of the Instance for whom Object:IsA() returns true for the given className. |
| Instance:FindFirstChild | Instance? | Returns the first child of the Instance found with the given name. |
| Instance:findFirstChild | Instance | |
| Instance:FindFirstChildOfClass | Instance? | Returns the first child of the Instance whose ClassName is equal to the given class name. |
| Instance:FindFirstChildWhichIsA | Instance? | Returns the first child of the Instance for whom Object:IsA() returns true for the given className. |
| Instance:FindFirstDescendant | Instance? | Returns the first descendant found with the given Instance.Name. |
| Instance:GetActor | Actor? | Returns the Actor associated with the Instance, if any. |
| Instance:GetAttribute | Variant | Returns the value which has been assigned to the given attribute name. |
| Instance:GetAttributeChangedSignal | RBXScriptSignal | Returns an event that fires when the given attribute changes. |
| Instance:GetAttributes | Dictionary | Returns a dictionary of the instance's attributes. |
| Instance:GetChildren | Instances | Returns an array containing all of the instance's children. |
| Instance:getChildren | Instances | |
| Instance:GetDebugId | string | Returns a coded string of the debug ID used internally by Roblox. |
| Instance:GetDescendants | Instances | Returns an array containing all of the descendants of the instance. |
| Instance:GetFullName | string | Returns a string describing the instance's ancestry. |
| Instance:GetStyled | Variant | Returns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified. |
| Instance:GetStyledPropertyChangedSignal | RBXScriptSignal | Returns an event that fires when the given style property changes on the instance. |
| Instance:GetTags | Array | Gets an array of all tags applied to the instance. |
| Instance:HasTag | boolean | Check whether the instance has a given tag. |
| Instance:IsAncestorOf | boolean | Returns true if an Instance is an ancestor of the given descendant. |
| Instance:IsDescendantOf | boolean | Returns true if an Instance is a descendant of the given ancestor. |
| Instance:isDescendantOf | boolean | |
| Instance:IsPropertyModified | boolean | Returns true if the value stored in the specified property is not equal to the code-instantiated default. |
| Instance:QueryDescendants | Instances | Returns 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:WaitForChild | Instance | Returns 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
| Name | Type / Returns | Description |
|---|---|---|
| Object:GetPropertyChangedSignal | RBXScriptSignal | Get an event that fires when a given property of the object changes. |
| Object:IsA | boolean | Returns true if an object's class matches or inherits from a given class. |
| Object:isA | boolean |
GeometryService:CalculateConstraintsToPreserve
Returns a table of Constraints and Attachments which you may choose to preserve, along with their respective parents. Iterating over this table lets you decide whether to reparent recommended constraints and attachments to their respective parents.
For more information and detailed examples, see https://create.roblox.com/docs/parts/solid-modeling#in-experience-solid-modeling.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| source | Instance | An original object that the solid modeling operation was performed on, for example part in UnionAsync(). | |
| destination | Array | Array of resulting BaseParts from the solid modeling operation, for example the results of UnionAsync(). | |
| options | Dictionary | nil | Options dictionary for the method: - tolerance — The distance tolerance, in regards to Attachment preservation, between the attachment and the closest point on the original part's surface versus the closest point on the resulting part's surface. If the resulting distance following the solid modeling operation is greater than this value, the Parent of attachments and their associated constraints will be nil in the returned recommendation table. - weldConstraintPreserve — A WeldConstraintPreserve enum value describing how WeldConstraints are preserved in the resulting recommendation table. - dropAttachmentsWithoutConstraints — Boolean with default of true. If set to false, Attachments that have no Constraints will be preserved. |
Returns
| Type | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Array | Table containing information for general case Constraints, NoCollisionConstraints, and WeldConstraints. In cases where an Attachment or Constraint should be dropped, its respective parent will be nil. For general case Constraints such as HingeConstraint:
WeldConstraints:
NoCollisionConstraints:
|
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["CSG"] |
Code samples: View on Creator Hub (GeometryService-CalculateConstraintsToPreserve).
GeometryService:FragmentAsync
Breaks a BasePart into multiple MeshPart instances, according to the pattern of points passed in, by using voronoi decomposition. Terrain is not supported. Similar to Clone(), the returned parts have no set Parent.
For more information and detailed examples, see https://create.roblox.com/docs/parts/solid-modeling#in-experience-solid-modeling.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| part | BasePart | A Part, PartOperation, or MeshPart to operate on. | |
| sites | Array | Array of Vector3 defining the site positions. Each site will become a separate part. You can also provide a jagged 2D array of Vector3 by including inner arrays of Vector3 as elements of the outer array. Each inner array will have all of its voronoi cells merged into a single part. GeometryService:GenerateFragmentSites can be used to easily create this input. | |
| options | Dictionary | nil | Options table containing all the controls for the method: - CollisionFidelity — The value of CollisionFidelity in the resulting parts, with one caveat: If a 2D array of sites is provided, this collision fidelity will only be applied to parts which came from more than one site. The others will be given Hull precision. - RenderFidelity — The value of RenderFidelity in the resulting parts. - FluidFidelity — The value of FluidFidelity in the resulting parts. - SplitApart — Boolean controlling whether a part should be split into multiple parts if it contains multiple connected components. Default is true (split). |
Returns
| Type | Description |
|---|---|
| Array | Array of MeshPart along with mapping info. Each array element is a Dictionary with two elements: { “Instance”: instance, “Index”: index }. Index is the index in the outer array of sites; in other words, it tells you which group of sites this instance came from. Note that it is possible for multiple instances to have the same index, if SplitApart is true. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["CSG"] |
Code samples: View on Creator Hub (GeometryService-FragmentAsync).
GeometryService:GenerateFragmentSites
Provides an array of positions which can easily be passed into FragmentAsync() to perform common types of destruction: Fragmenting an entire BasePart into pieces, or a localized area of a BasePart into pieces.
The positions outputted are partially random, so the output should not be relied on to look exactly the same as the first time it is run with the same parameters.
For more information and detailed examples, see https://create.roblox.com/docs/parts/solid-modeling#in-experience-solid-modeling. Luau code to mimic this API has also been provided on that page, which can be freely modified if a slightly different effect is desired.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| part | BasePart | The Part, PartOperation, or MeshPart which you are planning to pass into FragmentAsync(). This is necessary to make the fragment site generation and the subsequent FragmentAsync() call efficient. | |
| options | Dictionary | nil | Options table containing all the controls for the method: - SiteSpacing — The approximate distance between sites, which directly corresponds to the diameter of the resulting fragments. If not specified, a reasonable value will be chosen. - Origin — If provided, this will be the center of the area to be fragmented. If not provided, the entire object will be fragmented. - Radius — If provided, this will be the center of the area to be fragmented. Either Origin and Radius should both be provided, or neither. |
Returns
| Type | Description |
|---|---|
| Array | An array of Vector3 which is typically passed into FragmentAsync(). The output depends on the options provided. If Origin and Radius are provided, then the output array will contain several Vector3 elements which will all be located within the radius, but the first element of the array will be an inner array containing many Vector3 sites which are outside the radius. If Origin and Radius are not provided, the output will simply be an array of Vector3 positions within the extents of the input part. |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["CSG"] |
Code samples: View on Creator Hub (GeometryService-GenerateFragmentSites).
GeometryService:IntersectAsync
Creates one or more PartOperations or MeshParts from the intersecting geometry of multiple parts. Primitive Parts, PartOperations, and MeshParts are supported as inputs, but not Terrain.
Similarly to Clone(), the returned parts have no set Parent. In most cases, you should parent the results to the same place as the main part, then Destroy() the original parts.
This function replaces BasePart:IntersectAsync(). Go to that page for a description of the differences.
For more information and detailed examples, see https://create.roblox.com/docs/parts/solid-modeling#in-experience-solid-modeling.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| part | Instance | Main Part, PartOperation, or MeshPart to operate on. | |
| parts | Array | Array of other parts to intersect with the main part. | |
| options | Dictionary | nil | Options table containing all the controls for the method: - CollisionFidelity — The value of CollisionFidelity in the resulting parts. - RenderFidelity — The value of RenderFidelity or RenderFidelity in the resulting parts. - FluidFidelity — The value of FluidFidelity in the resulting parts. - SplitApart — Boolean controlling whether the objects should all be kept together or properly split apart. Default is true (split). |
Returns
| Type | Description |
|---|---|
| Array | One or more PartOperations or MeshParts. If the input contained any MeshParts, then the results will always be MeshParts. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["CSG"] |
Code samples: View on Creator Hub (GeometryService-IntersectAsync).
GeometryService:SubtractAsync
Creates one or more PartOperations or MeshParts consisting of the space occupied by one part minus the space occupied by the other parts. Primitive Parts, PartOperations, and MeshParts are supported as inputs, but not Terrain.
Similarly to Clone(), the returned parts have no set Parent. In most cases, you should parent the results to the same place as the main part, then Destroy() the original parts.
This function replaces BasePart:SubtractAsync(). Go to that page for a description of the differences.
For more information and detailed examples, see https://create.roblox.com/docs/parts/solid-modeling#in-experience-solid-modeling.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| part | Instance | Main Part, PartOperation, or MeshPart to operate on. | |
| parts | Array | Array of parts to subtract from the main part. | |
| options | Dictionary | nil | Options table containing all the controls for the method: - CollisionFidelity — The value of CollisionFidelity in the resulting parts. - RenderFidelity — The value of RenderFidelity or RenderFidelity in the resulting parts. - FluidFidelity — The value of FluidFidelity in the resulting parts. - SplitApart — Boolean controlling whether the objects should all be kept together or properly split apart. Default is true (split). |
Returns
| Type | Description |
|---|---|
| Array | One or more PartOperations or MeshParts. If the input contained any MeshParts, then the results will always be MeshParts. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["CSG"] |
Code samples: View on Creator Hub (GeometryService-SubtractAsync).
GeometryService:SweepPartAsync
Creates a MeshPart which has the shape of the input part stretched/dragged through the given set of CFrame positions. The exact shape of the result is defined as the union of the convex hulls of each adjacent pair of CFrames.
If a single CFrame is provided, the result will be a convex hull of the input part.
For more information and detailed examples, see https://create.roblox.com/docs/parts/solid-modeling#in-experience-solid-modeling.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| part | BasePart | A Part, PartOperation, or MeshPart to operate on. | |
| cframes | Array | Array of coordinate frames to sweep parts through. | |
| options | Dictionary | nil | Options table containing all the controls for the method: - CollisionFidelity — The value of CollisionFidelity in the resulting parts. - RenderFidelity — The value of RenderFidelity in the resulting parts. - FluidFidelity — The value of FluidFidelity in the resulting parts. |
Returns
| Type | Description |
|---|---|
| MeshPart | A new MeshPart with the swept geometry. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["CSG"] |
Code samples: View on Creator Hub (GeometryService-SweepPartAsync).
GeometryService:UnionAsync
Creates one or more PartOperations or MeshParts consisting of the space occupied by one part plus the space occupied by the other parts. Primitive Parts, PartOperations, and MeshParts are supported as inputs, but not Terrain.
Similarly to Clone(), the returned parts have no set Parent. In most cases, you should parent the results to the same place as the main part, then Destroy() the original parts.
This function replaces BasePart:UnionAsync(). Go to that page for a description of the differences.
For more information and detailed examples, see https://create.roblox.com/docs/parts/solid-modeling#in-experience-solid-modeling.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| part | Instance | Main Part, PartOperation, or MeshPart to operate on. | |
| parts | Array | Array of parts to union with the main part. | |
| options | Dictionary | nil | Options table containing all the controls for the method: - CollisionFidelity — The value of CollisionFidelity in the resulting parts. - RenderFidelity — The value of RenderFidelity or RenderFidelity in the resulting parts. - FluidFidelity — The value of FluidFidelity in the resulting parts. - SplitApart — Boolean controlling whether the objects should all be kept together or properly split apart. Default is true (split). |
Returns
| Type | Description |
|---|---|
| Array | One or more PartOperations or MeshParts. If the input contained any MeshParts, then the results will always be MeshParts. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["CSG"] |
Code samples: View on Creator Hub (GeometryService-UnionAsync).
Properties
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance.Archivable | boolean | Determines if an Instance and its descendants can be cloned using Instance:Clone(), and can be saved/published. |
| Instance.archivable | boolean | |
| Instance.Capabilities | SecurityCapabilities | The set of capabilities allowed to be used for scripts inside this container. |
| Instance.IsInSandbox | boolean | Indicates whether the instance is inside a sandboxed container. |
| Instance.Name | string | A non-unique identifier of the Instance. |
| Instance.Parent | Instance | Determines the hierarchical parent of the Instance. |
| Instance.PredictionMode | PredictionMode | Reflects the client-side prediction mode applied to the instance under server-authoritative physics. |
| Instance.RobloxLocked | boolean | A deprecated property that used to protect CoreGui objects. |
| Instance.Sandboxed | boolean | When enabled, the instance can only access abilities in its Capabilities list. |
| Instance.UniqueId | UniqueId | A unique identifier for the instance. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.ClassName | string | A read-only string representing the class this Object belongs to. |
| Object.className | string |
Events
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance.AncestryChanged | Fires when the Instance.Parent property of this object or one of its ancestors is changed. | |
| Instance.AttributeChanged | Fires whenever an attribute is changed on the Instance. | |
| Instance.ChildAdded | Fires after an object is parented to this Instance. | |
| Instance.childAdded | ||
| Instance.ChildRemoved | Fires after a child is removed from this Instance. | |
| Instance.DescendantAdded | Fires after a descendant is added to the Instance. | |
| Instance.DescendantRemoving | Fires immediately before a descendant of the Instance is removed. | |
| Instance.Destroying | Fires immediately before (or is deferred until after) the instance is destroyed via Instance:Destroy(). | |
| Instance.StyledPropertiesChanged | Fires whenever any style property is changed on the instance, including when a property is set to nil. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.Changed | Fires immediately after a property of the object changes, with some limitations. |