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

// 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;
    sceneObject: SceneObject;
    uniqueIdentifier: string;
    updateOrder: number;
    worldSettings: Physics.WorldSettingsAsset;
    createProbe(): Probe;
    destroy(): void;
    getSceneObject(): SceneObject;
    getTransform(): Transform;
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
}

Hierarchy (view full)

Properties

enabled: boolean

If disabled, the Component will stop enacting its behavior.

sceneObject: SceneObject
uniqueIdentifier: string
updateOrder: number

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.

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

Methods

  • Create an intersection probe for a specific world.

    Returns Probe

  • Destroys the component.

    Returns void

  • Returns the name of this object's type.

    Returns string

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

    Parameters

    • type: string

    Returns boolean

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

    Parameters

    Returns boolean