BaseConstraint||doc136279

September 20, 2022

BaseConstraint

This abstract class object cannot be created

Brief Introduction

Baseconstraint inherits from instance and provides additional information such as connected master-slave nodes. It is an abstract base class of constraints. The main uses of constraint base classes areConnect two parts to form the connection relationship of mechanical structure.

Attribute

BasePart SlaveNode
Connected slave node parts
bool Enabled
Whether to enable constraints
bool Visible
Whether constraints are visible in the game
Color3 Color
Constrain the color displayed in the game

Inherited FromInstance

string Name
Name of the instance
Instance Parent
Parent of the instance
Map Map [ReadOnly]
Scenario of the instance
string ClassName [ReadOnly]
Class name of the instance
int ID [ReadOnly]
Unique ID of the instance

Function

Inherited FromInstance

bool IsValid()
Get whether the instance object reference is valid
void Destroy()
Destroy instance
Instance Clone()
Clone the current instance
bool IsAncestorOfInstance instance )
Get whether it is the ancestor of an instance
bool IsDescendantOfInstance instance )
Get whether it is a descendant of an instance
bool IsClassstring className )
Get whether the instance type is a certain type
Instance FindFirstAncestorstring name )
Get the ancestor node instance by name
Instance FindFirstAncestorByClassstring className )
Get the ancestor node instance according to the type name
Instance FindFirstChildstring name, bool recursive )
Get child node instances by name
Instance FindFirstChildByClassstring name, bool recursive )
Get the child node instance according to the type name
table<Instance> GetChildrenbool recursive )
Get all child node instances
void AddChildInstance instance )
Add an instance to a child
void DestroyAllChildren()
Destroy all child node instances
BindableEvent GetEventstring eventName )
Get the bindable event of the instance

event

Inherited FromInstance

BindableEvent OnChildAdded
Triggered after adding child nodes to the instance
BindableEvent OnChildRemoved
Triggered after removing child nodes from an instance
BindableEvent OnDestroy
Triggered when the instance is about to be destroyed