Skip to content

Folder

A container for organizing instances. It has no behavior of its own.

  • Inherits: Instance
  • Creatable: Yes: new Folder(), or Instance.new('Folder', parent).
  • Replication: Replicated: clients get a copy, and changes the server makes reach them.

Use folders to group things in the tree. A Folder named leaderstats inside a Player is special: the values in it show on the in-game leaderboard (see createLeaderstats).

Inherited from Instance: name, archivable, id, className, parent, destroyed

Inherited from Instance: getPropertyChangedSignal, setAttribute, getAttribute, getAttributes, getAttributeChangedSignal, getChildren, getDescendants, findFirstChild, findFirstChildOfClass, findFirstChildWhichIsA, findFirstAncestor, findFirstAncestorWhichIsA, waitForChild, isA, isDescendantOf, isAncestorOf, getFullName, clearAllChildren, destroy, clone, toString

Inherited from Instance: changed, childAdded, childRemoved, descendantAdded, descendantRemoving, ancestryChanged, destroying, attributeChanged

import { Folder, Part, Vector3, workspace } from '@rally/sdk';
const coins = new Folder();
coins.name = 'Coins';
coins.parent = workspace;
for (let i = 0; i < 5; i++) {
const coin = new Part();
coin.shape = 'cylinder';
coin.size = new Vector3(2, 0.3, 2);
coin.position = new Vector3(i * 6, 3, 0);
coin.canCollide = false;
coin.parent = coins;
}