25 min read

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

SceneAnalysisService

Inherits from: Instance → Object

Provides programmatic access to the Scene Analysis tool's underlying performance data.

Inherits from: Instance

Memory category: Instances

Tags: NotCreatable, Service, NotReplicated

Methods

NameType / ReturnsDescription
SceneAnalysisService:GetAnimationMemoryAsyncAnimationMemoryResultReturns loaded animation clip memory. The same asset shared by multiple Animators appears only once, with all owners listed. #### Root dictionary | Key | Type | Description | | ---------- | ------ | ---------------------------------------------------------------- | | Name | string | Always "AnimationMemory". | | Size | number | Total loaded clip memory in bytes. | | Children | array | Array of clip entries and optionally an out-of-data model group. | #### Clip entry Each child in Children is either a clip entry or the "not in data model" group (see below). | Key | Type | Description | | --------- | ------ | ----------------------------------------------------------- | | Name | string | The asset ID (e.g. "rbxassetid://111"). | | Size | number | Clip memory in bytes. | | AssetId | string | The asset ID string (same value as Name). | | Owners | array | Array of owner entries for all Animators playing this clip. | #### Owner entry | Key | Type | Description | | ----------- | ------ | ---------------------------------------------------------------------------- | | Name | string | Full path to the owning Animator (e.g. "Workspace.NPC.Humanoid.Animator"). | | ClassName | string | Class name of the owner (e.g. "Animator"). | #### "Not in data model" group Clips from Animators held only by Lua (not parented in the data model) are collected into a single group entry. | Key | Type | Description | | ---------- | ------ | --------------------------------------------- | | Name | string | Always "Not In DataModel". | | Size | number | Sum of clip bytes in this group. | | Children | array | Array of clip entries (same schema as above). | #### Example lua { Name = "AnimationMemory", Size = 1048576, Children = { { Name = "rbxassetid://111", Size = 32768, AssetId = "rbxassetid://111", Owners = { { Name = "Workspace.Player.Humanoid.Animator", ClassName = "Animator" }, }}, { Name = "rbxassetid://444", Size = 65536, AssetId = "rbxassetid://444", Owners = { { Name = "Workspace.NPC1.Humanoid.Animator", ClassName = "Animator" }, { Name = "Workspace.NPC2.Humanoid.Animator", ClassName = "Animator" }, }}, { Name = "Not In DataModel", Size = 32768, Children = { { Name = "rbxassetid://555", Size = 32768, AssetId = "rbxassetid://555", Owners = { { Name = "Animator", ClassName = "Animator" }, }}, }}, } }
SceneAnalysisService:GetAudioMemoryAsyncAudioMemoryResultReturns loaded audio asset memory, deduplicated by asset ID. Assets whose owners share the same parent are organized under that parent path — flattened when there is one child, nested when there are several. Assets whose owners span different parents appear as shared entries with an Owners array. #### Root dictionary | Key | Type | Description | | ---------- | ------ | ------------------------------------------------------- | | Name | string | Always "AudioMemory". | | Size | number | Total loaded audio memory in bytes. | | Children | array | Mix of flat entries, parent groups, and shared entries. | #### Flat asset entry Emitted when a parent has exactly one audio child. | Key | Type | Description | | --------- | ------ | ---------------------------------------------------- | | Name | string | Full instance path (e.g. "Workspace.Map.BGMusic"). | | Size | number | Asset memory in bytes. | | AssetId | string | The audio asset ID. | #### Parent group Emitted when a parent has multiple audio children. | Key | Type | Description | | ---------- | ------ | ------------------------------------------------------------------ | | Name | string | Parent path (e.g. "Workspace.Map.SFX"). | | Size | number | Sum of child asset bytes. | | Children | array | Array of flat asset entries (each with Name, Size, AssetId). | #### Shared asset entry Emitted when an asset's owners are under different parents. | Key | Type | Description | | --------- | ------ | ------------------------------------------- | | Name | string | The asset ID. | | Size | number | Asset memory in bytes. | | AssetId | string | The asset ID string (same value as Name). | | Owners | array | Array of owner entries. | #### Owner entry | Key | Type | Description | | ----------- | ------ | ------------------------------------------------------ | | Name | string | Full instance path (e.g. "Workspace.Zone1.Ambient"). | | ClassName | string | "Sound" or "AudioPlayer". | #### Example lua { Name = "AudioMemory", Size = 5242880, Children = { -- Single audio under unique parent (flat) { Name = "Workspace.Map.BGMusic", Size = 2097152, AssetId = "rbxassetid://111" }, -- Multiple audio under same parent (grouped) { Name = "Workspace.Map.SFX", Size = 1048576, Children = { { Name = "Workspace.Map.SFX.Explosion", Size = 524288, AssetId = "rbxassetid://222" }, { Name = "Workspace.Map.SFX.Gunshot", Size = 524288, AssetId = "rbxassetid://333" }, }}, -- Shared asset (owners in different locations) { Name = "rbxassetid://444", Size = 2097152, AssetId = "rbxassetid://444", Owners = { { Name = "Workspace.Zone1.Ambient", ClassName = "Sound" }, { Name = "Workspace.Zone2.Ambient", ClassName = "Sound" }, }}, } }
SceneAnalysisService:GetInstanceCompositionAsyncInstanceCompositionResultReturns instance counts by category and class from the data model tree. Scans descendants of Workspace, Players, Lighting, MaterialService, ReplicatedFirst, ReplicatedStorage, ServerScriptService, ServerStorage, StarterGui, StarterPack, StarterPlayer, Teams, SoundService, and TextChatService. Each instance is classified into one of the categories below based on its class hierarchy. #### Root dictionary | Key | Type | Description | | ---------- | ------ | ------------------------------------------------- | | Name | string | Always "InstanceComposition". | | Size | number | Total instance count across all scanned services. | | Children | array | Array of category entries. | #### Category entry | Key | Type | Description | | ---------- | ------ | --------------------------------- | | Name | string | Category name (see table below). | | Size | number | Total instances in this category. | | Children | array | Array of class entries. | #### Class entry (leaf) | Key | Type | Description | | ------ | ------ | ------------------------------------------------------ | | Name | string | The class name (e.g. "Part", "Script", "Frame"). | | Size | number | Number of instances of this class. | #### Categories | Category | Representative Types | | ------------------ | ------------------------------------------------------------------------------------ | | 3D Objects | BasePart, Model, Camera | | Physics | Attachment, Constraint, JointInstance, WeldConstraint, ControllerManager, SensorBase | | UI | GuiBase, BasePlayerGui, UIBase, ProximityPrompt, ClickDetector, TextChannel | | Lights | Light | | PostProcessing | PostEffect, Highlight, Atmosphere, Sky, Clouds | | Scripts | LuaSourceContainer, BindableEvent, RemoteEvent, RemoteFunction | | Audio | Sound, SoundEffect, AudioPlayer, Wire, SoundGroup, AudioEmitter | | Animation | Animator, AnimationController, Animation, KeyframeSequence, IKControl | | Values | ValueBase | | Character | CharacterAppearance, Humanoid, HumanoidDescription, BaseWrap, FaceControls | | Textures | FaceInstance, SurfaceAppearance, MaterialVariant | | Meshes | DataModelMesh | | Particles | ParticleEmitter, Fire, Trail, Beam, Explosion | | Services & Storage | Player, Folder, Configuration | | Misc | Tool, Backpack, Team, ForceField, PathfindingModifier, PackageLink, HapticEffect | | Unclassified | Anything not matching the above | #### Example lua { Name = "InstanceComposition", Size = 12450, Children = { { Name = "3D Objects", Size = 5200, Children = { { Name = "Part", Size = 3100 }, { Name = "MeshPart", Size = 1800 }, { Name = "Model", Size = 300 }, }}, { Name = "UI", Size = 2100, Children = { { Name = "Frame", Size = 900 }, { Name = "TextLabel", Size = 700 }, { Name = "UIListLayout", Size = 500 }, }}, } }
SceneAnalysisService:GetScriptMemoryAsyncScriptMemoryResultReturns per-script Luau VM heap memory usage in bytes. Scripts are grouped first by their containing service (derived from the first segment of the dotted path), then split into "ModuleScripts" and "Scripts" subgroups based on the instance's class. #### Root dictionary | Key | Type | Description | | ---------- | ------ | ---------------------------------- | | Name | string | Always "ScriptMemory". | | Size | number | Total Luau VM memory in bytes. | | Children | array | Array of service category entries. | #### Service category entry | Key | Type | Description | | ---------- | ------ | ---------------------------------------------------------------------------- | | Name | string | Service name (e.g. "ServerScriptService", "ReplicatedStorage"). | | Size | number | Sum of all script memory in this service, in bytes. | | Children | array | One or two script-type group entries ("ModuleScripts" and/or "Scripts"). | #### Script-type group entry | Key | Type | Description | | ---------- | ------ | -------------------------------------------------- | | Name | string | Either "ModuleScripts" or "Scripts". | | Size | number | Sum of memory for scripts in this group, in bytes. | | Children | array | Array of individual script entries. | #### Script entry (leaf) | Key | Type | Description | | ------ | ------ | ---------------------------------------------------------------------- | | Name | string | Dotted path to the script (e.g. "ServerScriptService.Shared.Utils"). | | Size | number | Heap memory used by this script, in bytes. | #### Example lua { Name = "ScriptMemory", Size = 8388608, Children = { { Name = "ServerScriptService", Size = 524288, Children = { { Name = "ModuleScripts", Size = 409600, Children = { { Name = "ServerScriptService.Shared.Utils", Size = 204800 }, { Name = "ServerScriptService.Shared.Config", Size = 204800 }, }}, { Name = "Scripts", Size = 114688, Children = { { Name = "ServerScriptService.MainScript", Size = 114688 }, }}, }}, { Name = "ReplicatedStorage", Size = 262144, Children = { { Name = "ModuleScripts", Size = 262144, Children = { { Name = "ReplicatedStorage.SharedModule", Size = 262144 }, }}, }}, } }
SceneAnalysisService:GetTriangleCompositionAsyncTriangleCompositionResultReturns triangle and draw call counts by render pass, sourced from StatsService performance data. Unlike other queries, this uses a Sizes dictionary (with Triangles and Drawcalls keys) instead of a single Size field. Render pass entries with zero triangles and zero draw calls are omitted. #### Root dictionary | Key | Type | Description | | ---------- | ---------- | ---------------------------------------------------------------------- | | Name | string | Always "TriangleComposition". | | Sizes | dictionary | { Triangles: number, Drawcalls: number } — totals across all passes. | | Children | array | Array of render pass entries. | #### Render pass entry (leaf) | Key | Type | Description | | ------- | ---------- | --------------------------------------------------------- | | Name | string | Render pass type (see table below). | | Sizes | dictionary | { Triangles: number, Drawcalls: number } for this pass. | #### Render pass types | Name | Description | | ------------------ | ------------------------------ | | Opaque | Opaque geometry | | Transparent | Transparent geometry | | Terrain | Voxel/smooth terrain | | Grass | Terrain grass decoration | | UI | Screen-space UI | | Decal | Decal rendering | | Cloud | Volumetric clouds | | GenericPostProcess | Generic post-processing | | SSAO | Screen-space ambient occlusion | | DOF | Depth of field | | Particles | Particle systems | | Sky | Skybox | | Shadows | Shadow map rendering | | Undefined | Uncategorized | #### Example lua { Name = "TriangleComposition", Sizes = { Triangles = 245000, Drawcalls = 1200 }, Children = { { Name = "Opaque", Sizes = { Triangles = 180000, Drawcalls = 800 } }, { Name = "Transparent", Sizes = { Triangles = 25000, Drawcalls = 150 } }, { Name = "Shadows", Sizes = { Triangles = 30000, Drawcalls = 200 } }, { Name = "UI", Sizes = { Triangles = 10000, Drawcalls = 50 } }, } }
SceneAnalysisService:GetUnparentedInstancesAsyncUnparentedInstancesResultReturns instances held by Luau but no longer in the data model, grouped by host script. Each unparented instance is traced back to the script that holds the reference. Unparented instances that are flagged for garbage collection but not yet deleted are temporarily shown with a parent of Unknown. This is a side effect of how garbage collection is intended to work and not indicative of any problems. #### Root dictionary | Key | Type | Description | | ---------- | ------ | ------------------------------------ | | Name | string | Always "UnparentedInstances". | | Size | number | Total count of unparented instances. | | Children | array | Array of host script entries. | #### Host script entry | Key | Type | Description | | ---------- | ------ | ------------------------------------------------------------------------------------------- | | Name | string | Script path (e.g. "ServerScriptService.Gameplay.Combat") or "(unknown)" if untraceable. | | Size | number | Count of unparented instances held by this script. | | Children | array | Array of class entries. | #### Class entry (leaf) | Key | Type | Description | | ------ | ------ | ---------------------------------------------------------------------------- | | Name | string | Class name of the unparented instance (e.g. "Part", "Frame", "Sound"). | | Size | number | Count of unparented instances of this class from this host script. | #### Example lua { Name = "UnparentedInstances", Size = 47, Children = { { Name = "ServerScriptService.Gameplay.Combat", Size = 30, Children = { { Name = "Part", Size = 22 }, { Name = "Attachment", Size = 8 }, }}, { Name = "(unknown)", Size = 17, Children = { { Name = "Frame", Size = 12 }, { Name = "Sound", Size = 5 }, }}, } }

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

SceneAnalysisService:GetAnimationMemoryAsync

Returns loaded animation clip memory. The same asset shared by multiple Animators appears only once, with all owners listed.

Root dictionary

KeyTypeDescription
NamestringAlways "AnimationMemory".
SizenumberTotal loaded clip memory in bytes.
ChildrenarrayArray of clip entries and optionally an out-of-data model group.

Clip entry

Each child in Children is either a clip entry or the "not in data model" group (see below).

KeyTypeDescription
NamestringThe asset ID (e.g. "rbxassetid://111").
SizenumberClip memory in bytes.
AssetIdstringThe asset ID string (same value as Name).
OwnersarrayArray of owner entries for all Animators playing this clip.

Owner entry

KeyTypeDescription
NamestringFull path to the owning Animator (e.g. "Workspace.NPC.Humanoid.Animator").
ClassNamestringClass name of the owner (e.g. "Animator").

"Not in data model" group

Clips from Animators held only by Lua (not parented in the data model) are collected into a single group entry.

KeyTypeDescription
NamestringAlways "Not In DataModel".
SizenumberSum of clip bytes in this group.
ChildrenarrayArray of clip entries (same schema as above).

Example

{
  Name = "AnimationMemory",
  Size = 1048576,
  Children = {
    { Name = "rbxassetid://111", Size = 32768, AssetId = "rbxassetid://111",
      Owners = {
        { Name = "Workspace.Player.Humanoid.Animator", ClassName = "Animator" },
    }},
    { Name = "rbxassetid://444", Size = 65536, AssetId = "rbxassetid://444",
      Owners = {
        { Name = "Workspace.NPC1.Humanoid.Animator", ClassName = "Animator" },
        { Name = "Workspace.NPC2.Humanoid.Animator", ClassName = "Animator" },
    }},
    { Name = "Not In DataModel", Size = 32768, Children = {
        { Name = "rbxassetid://555", Size = 32768, AssetId = "rbxassetid://555",
          Owners = {
            { Name = "Animator", ClassName = "Animator" },
        }},
    }},
  }
}

Returns

TypeDescription
AnimationMemoryResultA dictionary tree of loaded animation clip memory, deduplicated by clip.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe

SceneAnalysisService:GetAudioMemoryAsync

Returns loaded audio asset memory, deduplicated by asset ID. Assets whose owners share the same parent are organized under that parent path — flattened when there is one child, nested when there are several. Assets whose owners span different parents appear as shared entries with an Owners array.

Root dictionary

KeyTypeDescription
NamestringAlways "AudioMemory".
SizenumberTotal loaded audio memory in bytes.
ChildrenarrayMix of flat entries, parent groups, and shared entries.

Flat asset entry

Emitted when a parent has exactly one audio child.

KeyTypeDescription
NamestringFull instance path (e.g. "Workspace.Map.BGMusic").
SizenumberAsset memory in bytes.
AssetIdstringThe audio asset ID.

Parent group

Emitted when a parent has multiple audio children.

KeyTypeDescription
NamestringParent path (e.g. "Workspace.Map.SFX").
SizenumberSum of child asset bytes.
ChildrenarrayArray of flat asset entries (each with Name, Size, AssetId).

Shared asset entry

Emitted when an asset's owners are under different parents.

KeyTypeDescription
NamestringThe asset ID.
SizenumberAsset memory in bytes.
AssetIdstringThe asset ID string (same value as Name).
OwnersarrayArray of owner entries.

Owner entry

KeyTypeDescription
NamestringFull instance path (e.g. "Workspace.Zone1.Ambient").
ClassNamestring"Sound" or "AudioPlayer".

Example

{
  Name = "AudioMemory",
  Size = 5242880,
  Children = {
    -- Single audio under unique parent (flat)
    { Name = "Workspace.Map.BGMusic", Size = 2097152,
      AssetId = "rbxassetid://111" },

    -- Multiple audio under same parent (grouped)
    { Name = "Workspace.Map.SFX", Size = 1048576, Children = {
        { Name = "Workspace.Map.SFX.Explosion", Size = 524288, AssetId = "rbxassetid://222" },
        { Name = "Workspace.Map.SFX.Gunshot",   Size = 524288, AssetId = "rbxassetid://333" },
    }},

    -- Shared asset (owners in different locations)
    { Name = "rbxassetid://444", Size = 2097152, AssetId = "rbxassetid://444",
      Owners = {
        { Name = "Workspace.Zone1.Ambient", ClassName = "Sound" },
        { Name = "Workspace.Zone2.Ambient", ClassName = "Sound" },
    }},
  }
}

Returns

TypeDescription
AudioMemoryResultA dictionary tree of loaded audio asset memory, deduplicated by asset ID.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe

SceneAnalysisService:GetInstanceCompositionAsync

Returns instance counts by category and class from the data model tree. Scans descendants of Workspace, Players, Lighting, MaterialService, ReplicatedFirst, ReplicatedStorage, ServerScriptService, ServerStorage, StarterGui, StarterPack, StarterPlayer, Teams, SoundService, and TextChatService. Each instance is classified into one of the categories below based on its class hierarchy.

Root dictionary

KeyTypeDescription
NamestringAlways "InstanceComposition".
SizenumberTotal instance count across all scanned services.
ChildrenarrayArray of category entries.

Category entry

KeyTypeDescription
NamestringCategory name (see table below).
SizenumberTotal instances in this category.
ChildrenarrayArray of class entries.

Class entry (leaf)

KeyTypeDescription
NamestringThe class name (e.g. "Part", "Script", "Frame").
SizenumberNumber of instances of this class.

Categories

CategoryRepresentative Types
3D ObjectsBasePart, Model, Camera
PhysicsAttachment, Constraint, JointInstance, WeldConstraint, ControllerManager, SensorBase
UIGuiBase, BasePlayerGui, UIBase, ProximityPrompt, ClickDetector, TextChannel
LightsLight
PostProcessingPostEffect, Highlight, Atmosphere, Sky, Clouds
ScriptsLuaSourceContainer, BindableEvent, RemoteEvent, RemoteFunction
AudioSound, SoundEffect, AudioPlayer, Wire, SoundGroup, AudioEmitter
AnimationAnimator, AnimationController, Animation, KeyframeSequence, IKControl
ValuesValueBase
CharacterCharacterAppearance, Humanoid, HumanoidDescription, BaseWrap, FaceControls
TexturesFaceInstance, SurfaceAppearance, MaterialVariant
MeshesDataModelMesh
ParticlesParticleEmitter, Fire, Trail, Beam, Explosion
Services & StoragePlayer, Folder, Configuration
MiscTool, Backpack, Team, ForceField, PathfindingModifier, PackageLink, HapticEffect
UnclassifiedAnything not matching the above

Example

{
  Name = "InstanceComposition",
  Size = 12450,
  Children = {
    { Name = "3D Objects", Size = 5200, Children = {
        { Name = "Part", Size = 3100 },
        { Name = "MeshPart", Size = 1800 },
        { Name = "Model", Size = 300 },
    }},
    { Name = "UI", Size = 2100, Children = {
        { Name = "Frame", Size = 900 },
        { Name = "TextLabel", Size = 700 },
        { Name = "UIListLayout", Size = 500 },
    }},
  }
}

Returns

TypeDescription
InstanceCompositionResultA dictionary tree of instance counts grouped by category and class name.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe

SceneAnalysisService:GetScriptMemoryAsync

Returns per-script Luau VM heap memory usage in bytes. Scripts are grouped first by their containing service (derived from the first segment of the dotted path), then split into "ModuleScripts" and "Scripts" subgroups based on the instance's class.

Root dictionary

KeyTypeDescription
NamestringAlways "ScriptMemory".
SizenumberTotal Luau VM memory in bytes.
ChildrenarrayArray of service category entries.

Service category entry

KeyTypeDescription
NamestringService name (e.g. "ServerScriptService", "ReplicatedStorage").
SizenumberSum of all script memory in this service, in bytes.
ChildrenarrayOne or two script-type group entries ("ModuleScripts" and/or "Scripts").

Script-type group entry

KeyTypeDescription
NamestringEither "ModuleScripts" or "Scripts".
SizenumberSum of memory for scripts in this group, in bytes.
ChildrenarrayArray of individual script entries.

Script entry (leaf)

KeyTypeDescription
NamestringDotted path to the script (e.g. "ServerScriptService.Shared.Utils").
SizenumberHeap memory used by this script, in bytes.

Example

{
  Name = "ScriptMemory",
  Size = 8388608,
  Children = {
    { Name = "ServerScriptService", Size = 524288, Children = {
        { Name = "ModuleScripts", Size = 409600, Children = {
            { Name = "ServerScriptService.Shared.Utils", Size = 204800 },
            { Name = "ServerScriptService.Shared.Config", Size = 204800 },
        }},
        { Name = "Scripts", Size = 114688, Children = {
            { Name = "ServerScriptService.MainScript", Size = 114688 },
        }},
    }},
    { Name = "ReplicatedStorage", Size = 262144, Children = {
        { Name = "ModuleScripts", Size = 262144, Children = {
            { Name = "ReplicatedStorage.SharedModule", Size = 262144 },
        }},
    }},
  }
}

Returns

TypeDescription
ScriptMemoryResultA dictionary tree of per-script Luau VM heap memory grouped by service and script type.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe

SceneAnalysisService:GetTriangleCompositionAsync

Returns triangle and draw call counts by render pass, sourced from StatsService performance data. Unlike other queries, this uses a Sizes dictionary (with Triangles and Drawcalls keys) instead of a single Size field. Render pass entries with zero triangles and zero draw calls are omitted.

Root dictionary

KeyTypeDescription
NamestringAlways "TriangleComposition".
Sizesdictionary{ Triangles: number, Drawcalls: number } — totals across all passes.
ChildrenarrayArray of render pass entries.

Render pass entry (leaf)

KeyTypeDescription
NamestringRender pass type (see table below).
Sizesdictionary{ Triangles: number, Drawcalls: number } for this pass.

Render pass types

NameDescription
OpaqueOpaque geometry
TransparentTransparent geometry
TerrainVoxel/smooth terrain
GrassTerrain grass decoration
UIScreen-space UI
DecalDecal rendering
CloudVolumetric clouds
GenericPostProcessGeneric post-processing
SSAOScreen-space ambient occlusion
DOFDepth of field
ParticlesParticle systems
SkySkybox
ShadowsShadow map rendering
UndefinedUncategorized

Example

{
  Name = "TriangleComposition",
  Sizes = { Triangles = 245000, Drawcalls = 1200 },
  Children = {
    { Name = "Opaque",      Sizes = { Triangles = 180000, Drawcalls = 800 } },
    { Name = "Transparent", Sizes = { Triangles = 25000,  Drawcalls = 150 } },
    { Name = "Shadows",     Sizes = { Triangles = 30000,  Drawcalls = 200 } },
    { Name = "UI",          Sizes = { Triangles = 10000,  Drawcalls = 50  } },
  }
}

Returns

TypeDescription
TriangleCompositionResultA dictionary tree of triangle and draw call counts broken down by render pass type.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe

SceneAnalysisService:GetUnparentedInstancesAsync

Returns instances held by Luau but no longer in the data model, grouped by host script. Each unparented instance is traced back to the script that holds the reference.

Unparented instances that are flagged for garbage collection but not yet deleted are temporarily shown with a parent of Unknown. This is a side effect of how garbage collection is intended to work and not indicative of any problems.

Root dictionary

KeyTypeDescription
NamestringAlways "UnparentedInstances".
SizenumberTotal count of unparented instances.
ChildrenarrayArray of host script entries.

Host script entry

KeyTypeDescription
NamestringScript path (e.g. "ServerScriptService.Gameplay.Combat") or "(unknown)" if untraceable.
SizenumberCount of unparented instances held by this script.
ChildrenarrayArray of class entries.

Class entry (leaf)

KeyTypeDescription
NamestringClass name of the unparented instance (e.g. "Part", "Frame", "Sound").
SizenumberCount of unparented instances of this class from this host script.

Example

{
  Name = "UnparentedInstances",
  Size = 47,
  Children = {
    { Name = "ServerScriptService.Gameplay.Combat", Size = 30, Children = {
        { Name = "Part", Size = 22 },
        { Name = "Attachment", Size = 8 },
    }},
    { Name = "(unknown)", Size = 17, Children = {
        { Name = "Frame", Size = 12 },
        { Name = "Sound", Size = 5 },
    }},
  }
}

Returns

TypeDescription
UnparentedInstancesResultA dictionary tree of unparented instances grouped by the host script holding the reference.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe

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.