Instance Explorer
Walk the DataModel tree, resolve classes, names, and paths.
The instance explorer. These are the External's replacement for indexing the tree: every one takes an address and gives you either another address or a plain value.
Two ways down the tree
local dm = get_datamodel()
-- Straight down a known path.
local part = find_instance_by_path("Workspace.Model.Head")
-- Or step by step, when the path is not fixed.
local workspace_ = find_first_child(dm, "Workspace")
for _, child in ipairs(get_children(workspace_)) do
if get_classname(child) == "Model" then
local head = find_first_descendant(child, "Head")
if head ~= 0 then
print(get_instance_path(head))
end
end
endPrefer find_first_child to scanning
get_children allocates a table of every child. In a per-frame loop over a large Workspace that adds up — reach for the targeted finders where you can.