Reference API Roblox

Engine API

Website

Related

Reference API Roblox

SceneAnalysisService

This class is not replicated. Its interface does not cross the network boundary.
This class is not creatable. Instances of this class cannot be created with Instance.new.
This class is a service. It is a singleton that may be acquired with GetService.
Tags: [NotCreatable, Service, NotReplicated]

Member index 6

HistoryMember
718GetAnimationMemoryAsync(): Dictionary
718GetAudioMemoryAsync(): Dictionary
718GetInstanceCompositionAsync(): Dictionary
718GetScriptMemoryAsync(): Dictionary
718GetTriangleCompositionAsync(): Dictionary
718GetUnparentedInstancesAsync(): Dictionary
inherited from Instance
553Archivable: bool
670Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
702PredictionMode: PredictionMode
670Sandboxed: bool
680UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Description

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

History 7

Members 6

GetAnimationMemoryAsync

Parameters (0)
No parameters.
Returns (1)
Dictionary

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
  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" },
        }},
    }},
  }
}
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

GetAudioMemoryAsync

Parameters (0)
No parameters.
Returns (1)
Dictionary

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  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" },
    }},
  }
}
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

GetInstanceCompositionAsync

Parameters (0)
No parameters.
Returns (1)
Dictionary

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{
  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 },
    }},
  }
}
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

GetScriptMemoryAsync

Parameters (0)
No parameters.
Returns (1)
Dictionary

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
{
  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 },
        }},
    }},
  }
}
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

GetTriangleCompositionAsync

Parameters (0)
No parameters.
Returns (1)
Dictionary

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  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  } },
  }
}
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

GetUnparentedInstancesAsync

Parameters (0)
No parameters.
Returns (1)
Dictionary

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
  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 },
    }},
  }
}
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

Settings