System
DynamicInstance
DynamicInstance
is the base class where all objects within the game world with dynamic properties (position, rotation, scale) derive from.
Abstract class
DynamicInstance
cannot be derived from directly. Instead, use one of the classes that derive from DynamicInstance
.
Inheritance
DynamicInstance
inherits from Instance
.
Methods
LookAt
Rotates the object so that the forward vector points at the target position.
Parameters
Name | Type | Description |
---|---|---|
target | Vector3 | The position to look at. |
Example
Lua
local part = Instance.new("Part")
part.Position = Vector3.new(0, 0, 0)
part:LookAt(Vector3.new(0, 0, 10))
TypeScript
const part = new Part();
part.Position = new Vector3(0, 0, 0);
part.LookAt(new Vector3(0, 0, 10));
Returns
Returns void
.
Translate
Moves the object by the specified offset.
Parameters
Name | Type | Description |
---|---|---|
offset | Vector3 | The offset to move by. |
Returns
Returns void
.
Properties
Forward
The forward vector of the object.
Type
LocalPosition
The position of the object relative to its parent.
Type
LocalRotation
The rotation of the object relative to its parent.
Euler angles
The rotation is represented in Euler angles.
Type
LocalScale
The scale of the object relative to its parent.
Type
Right
The right vector of the object.
Type
Up
The up vector of the object.
Type
Position
The position of the object in world space.
Type
Rotation
The rotation of the object in world space.
Euler angles
The rotation is represented in Euler angles.
Type
Scale
The scale of the object in world space.