MovableNode||doc136277

September 20, 2022

MovableNode

This abstract class object cannot be created

Brief Introduction

Movablenode inherits from instance and provides additional spatial transformation information and movement functions. It is an abstract base class for all movable objects. The main function of a movable node is to control the movement, rotation and scaling of instances in the scene. When instances inherited from this class are moved, rotated and scaled, it will drive the child objects to carry out spatial transformation. For example, when the parent node moves, the child nodes will also move with it, and when the parent node rotates, the child nodes will also rotate with it.

Attribute

Vector3 WorldPosition
Global coordinates
Vector3 WorldRotation
Global rotation
Vector3 WorldScale
Global zoom
Vector3 LocalPosition
Local coordinates
Vector3 LocalRotation
Local rotation
Vector3 LocalScale
Local zoom
Vector3 ForwardVector
Forward vector
Vector3 LeftVector
Vector in the left direction
Vector3 UpVector
Up vector

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

void RotateVector3 rotation, bool worldSpace )
rotate
void RotateAroundVector3 center, Vector3 axis, float angle )
Rotate around an axis at a point
void MoveVector3 displacement, bool worldSpace )
move

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