Class EnginePart

Represents an engine.

Hierarchy

  • Child

    Hierarchy

    • EnginePart

Constructors

Properties

fileChild: FileChild
fileShape: FileShape

Accessors

  • get color(): string
  • The color of this shape.

    Returns string

  • set color(value: string): void
  • Parameters

    • value: string

    Returns void

  • get level(): number
  • The level of the engine.

    Note

    Attempting to get this property from an engine in a blueprint saved in-game, without first setting it with this API, has a chance to return 0 instead of the actual level. This is due to some shenanigans with the way engine levels are stored within serialized Lua data.

    Returns number

  • set level(value: number): void
  • Parameters

    • value: number

    Returns void

  • get shapeId(): string
  • The shapeId of this shape. Determines the model and behavior in-game.

    Returns string

  • set shapeId(value: string): void
  • Parameters

    • value: string

    Returns void

Methods

  • Connects this child to another child. Both children must be interactable.

    Parameters

    • other: number | Child

      The Child object or the ID of the child to connect to.

    Returns void

  • Disconnects this child from another child.

    Parameters

    • other: number | Child

      The Child object or the ID of the child to disconnect from.

    Returns void

  • Gets a list of IDs for any bearings connected to this engine.

    Returns

    Returns number[]

  • Adds or updates a connection to a bearing.

    Parameters

    • bearing: number | BearingJoint

      The bearing to connect to. Can be an ID.

    • reversed: boolean = false

      Whether the bearing spins counter-clockwise looking from the front. Defaults to false.

    Returns void

  • Creates an engine.

    Returns

    The created engine.

    Parameters

    • position: Vector3

      The position of the engine.

    • rotation: Axis

      The rotation of the engine.

    • Optional color: string

      The color of the engine. Fallbacks to the engine's default color.

    • level: number = 0

      The level of the engine. Defaults to 0.

    • electric: boolean = false

      Whether the engine is electric. Defaults to false.

    Returns EnginePart

Generated using TypeDoc