TruWorlds

DynamicInstance

Inherits: VisualInstance

DynamicInstance is an Instance that has a position and rotation in the world, represented by a CMatrix.

Properties

CMatrix CMatrix

The coordinate matrix (CMatrix) representing the DynamicInstance's position and rotation transform in the world, in local space.

Position Vector3

The position of the DynamicInstance. This is a shortcut for setting CMatrix.Position.

Quaternion Quaternion

The rotation of the DynamicInstance as a quaternion. This is a shortcut for setting Types.CMatrix.Quaternion.

Rotation Vector3

The rotation of the DynamicInstance in Euler angles (degrees). This is a shortcut for setting Quaternion using Euler angles.

Functions

Speak(text: string)

Creates a child speech bubble attached to this DynamicInstance with the given text.

text
The text to display in the speech bubble.
duration
The duration (in seconds) for which the speech bubble should be displayed before automatically being removed. Default is 5 seconds.
local npc = world.FindFirstChild("Shopkeeper")
if npc:
    npc.Speak("Welcome to my shop!", 4)