Instance class is the base class of the object system. All other classes inherit, either directly or indirectly, from this class. The members that are common to all the OpenBlox objects belong to the
Instance class. This is why many of the most important and most used members belong to this class.
- 1 Properties
- 2 Methods
- 2.1 void ClearAllChildren()
- 2.2 Instance Clone()
- 2.3 void Destroy()
- 2.4 void Remove()
- 2.5 Instance FindFirstChild(string name, boolean recursive = false)
- 2.6 Instance GetChildren()
- 2.7 string GetFullName()
- 2.8 boolean IsA(string className)
- 2.9 boolean IsAncestorOf(Instance otherInstance)
- 2.10 boolean IsDescendantOf(Instance otherInstance)
- 2.11 int GetNetworkID()
- 3 Events
The value of this property determines whether the object can be serialized. The object will only be cloned or saved when this property is true. By default, this is true.
string ClassName [read-only]
The value of this property is the name of the class (e.g. "Camera") the object belongs to.
The value of this property is the name of this Instance. This property is used to determine which Instance, if any, will be returned when indexing an Instance. By default, Name is set to the ClassName of this Instance.
The value of this property is the hierarchical parent of this Instance, in the scene graph. By default, this property is set to
This method sets the parent of all the descendants of the object to
This method creates a new Instance of this class (if the Instance is Archivable and the class is not abstract or uncreatable), and sets all properties to the same value as this one. All children will be cloned as well, and their Parent property will be set to this Instance. The Parent property of the Instance returned by this method will be
If the Archivable property is set to
false, or the class is abstract or uncreatable, this method will return
This method is used to parent the object to
nil and remove all references. All connections to events of this Instance will be disconnected. Calling this method will parent-lock the Instance, meaning that the Instance's Parent property can not be changed after this method is called.
This method sets the Parent property to
nil, and recursively calls itself on children of this Instance.
string name, boolean recursive = false) FindFirstChild(
This method is used to find the first child of this Instance, with a given Name name. If recursive is
true, this method will search all descendants of this Instance for the first Instance with the Name name.
This method returns all children of this Instance in an array.
This method returns the full name of this Instance. Usually in the form of
game.Service.Thing, can return weird things when one of the ancestors of this Instance is parented to
boolean IsA(string className)
This method returns
true if this class inherits from the class of the given name, className. If there is no class with the name className, this method will always return
boolean IsAncestorOf( otherInstance)
This method returns
true if otherInstance is not
nil and this Instance is an ancestor of otherInstance.
boolean IsDescendantOf( otherInstance)
This method returns
true if otherInstance is
nil or this Instance is a descendant of otherInstance.
This method returns an integer used to represent this Instance in network transactions. This can be 0 if this Instance isn't assigned a network ID.
AncestryChanged( child, parent)
This event is fired when a property of this Instance is changed. property will be the name of the property that was changed.
This event is fired when a child is added to this Instance. kid is the new child.
This event is fired when a child is removed from this Instance. kid is the Instance whose ancestry has been changed.
This event is fired when a descendant is added to this Instance. descendant is the descendant that has been added to this Instance's hierarchy.
This event is fired when a descendant of this Instance is removed. descendant is the descendant that is being removed from this Instance.