Description

Groups physics objects in its subtree into an independent world simulation.

Example

// Change gravity in a given World Component 

// @input Physics.WorldComponent worldComponent
script.worldComponent.worldSettings.gravity = new vec3(0.0, -300.0, 0.0);
interface WorldComponent {
    enabled: boolean;
    uniqueIdentifier: string;
    updateOrder: number;
    worldSettings: WorldSettingsAsset;
    createProbe(): Probe;
    destroy(): void;
    getSceneObject(): SceneObject;
    getTransform(): Transform;
    getTypeName(): string;
    isOfType(type): boolean;
    isSame(other): boolean;
}

Hierarchy (view full)

Properties

enabled: boolean

Description

If disabled, the Component will stop enacting its behavior.

uniqueIdentifier: string
updateOrder: number

Description

Update order of this world relative to other worlds (lower values are earlier). The implicit root world order is 0, so worlds with negative order will update before the root world, and worlds with non-negative order update after.

worldSettings: WorldSettingsAsset

Description

Reference to world settings. If not set, use the default world settings for the project.

Methods

  • Returns Probe

    Description

    Create an intersection probe for a specific world.

  • Returns void

    Description

    Destroys the component.

  • Returns string

    Description

    Returns the name of this object's type.

  • Parameters

    • type: string

    Returns boolean

    Description

    Returns true if the object matches or derives from the passed in type.

  • Parameters

    Returns boolean

    Description

    Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Generated using TypeDoc