TruWorlds

Model

Inherits: VisualInstance

Model is a special type of PhysicsInstance that can contain other PhysicsInstance instances as children. Physics instances parented to a Model will be joined together and move as a single unit.

Properties

CMatrix CMatrix

The model's transform (from its primary physics body). Setting it pivots the whole model there.

Position Vector3

The model's position (from its primary physics body). Setting it pivots the whole model there (rotation kept).

PrimaryBody Instance?

Functions

MakeJoints()

Welds all touching parts within the model together, allowing them to move as a single unit.

MakeJointsToPrimaryBody()

Welds every physics part within the model directly to the model's primary body. Unlike MakeJoints, this does not require parts to be touching — every part gets a weld straight to the primary body regardless of proximity.

PivotTo(target: CMatrix)

Rigidly moves the whole model so its primary physics body lands on , carrying every part along (relative offsets preserved). No-op without a primary physics body.

RemoveJoints() Returns int

Removes all welds connected to any physics instance within this model.

SetNetworkOwner(player: Player)

Grants physics authority over every part in the model (nil releases to the server). A welded assembly must share one owner, so set it here rather than per-body.