Instance access children||doc136847

September 20, 2022

Instance objects can be passed directly The name of the child can access the child instance object. For example, if you want to access the instance named "sceneuia" in the scene, you can use Access.

image.png

local map = World:GetStaticMap("map001")
local sceneUI = map.Root.Folder.PartA.SceneUIA

When there are two instances with the same name under the same level Will access the first instance.

image.png

local map = World:GetStaticMap("map001")
local part = map.Root.Folder.PartA
print(part.ID)

It can be found by comparing the instance ID printed with the instance ID in the editor Will access the first instance.

When the name of the child instance has the same name as the attribute of the parent Will access properties.

image.png

local map = World:GetStaticMap("map001")
print(map.Root.Folder.Name)