ReferenceInstances

getobjects

Loads an asset's objects without inserting them into the game.

Syntax

getobjects(asset: string | number) -> {Instance}

Parameters

ParameterTypeDescription
assetstring or numberAn rbxassetid:// url or numeric asset id.

Returns

TypeDescription
{Instance}The asset's objects, unparented.

Description

It calls game:GetObjects; when that returns nothing it loads the asset with InsertService:LoadLocalAsset. A failed load raises an error.

Example

local objects = getobjects("rbxassetid://125013769")
print(objects[1] and objects[1].ClassName)

These are Game executor contracts. Check build requirements and session lifetimes before using them.