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

NameTypeDescription
targetVector3The 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

NameTypeDescription
offsetVector3The offset to move by.

Returns

Returns void.

Properties

Forward

The forward vector of the object.

Type

Vector3

LocalPosition

The position of the object relative to its parent.

Type

Vector3

LocalRotation

The rotation of the object relative to its parent.

Euler angles

The rotation is represented in Euler angles.

Type

Vector3

LocalScale

The scale of the object relative to its parent.

Type

Vector3

The right vector of the object.

Type

Vector3

Up

The up vector of the object.

Type

Vector3

Position

The position of the object in world space.

Type

Vector3

Rotation

The rotation of the object in world space.

Euler angles

The rotation is represented in Euler angles.

Type

Vector3

Scale

The scale of the object in world space.

Type

Vector3

Previous
ValueBase