Folder
A container for organizing instances. It has no behavior of its own.
- Inherits: Instance
- Creatable: Yes:
new Folder(), orInstance.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).
Properties
Section titled “Properties”Inherited from Instance: name, archivable, id, className, parent, destroyed
Methods
Section titled “Methods”Inherited from Instance: getPropertyChangedSignal, setAttribute, getAttribute, getAttributes, getAttributeChangedSignal, getChildren, getDescendants, findFirstChild, findFirstChildOfClass, findFirstChildWhichIsA, findFirstAncestor, findFirstAncestorWhichIsA, waitForChild, isA, isDescendantOf, isAncestorOf, getFullName, clearAllChildren, destroy, clone, toString
Events
Section titled “Events”Inherited from Instance: changed, childAdded, childRemoved, descendantAdded, descendantRemoving, ancestryChanged, destroying, attributeChanged
Examples
Section titled “Examples”Group objects
Section titled “Group objects”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;}