Class SensorPart

Represents a sensor.

Hierarchy

  • Child

    Hierarchy

    • SensorPart

Constructors

Properties

fileChild: FileChild
fileShape: FileShape

Accessors

  • get audioEnabled(): boolean
  • Whether the sensor plays audio when activated.

    Returns boolean

  • set audioEnabled(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get buttonMode(): boolean
  • Whether the sensor will only be active while sensing, instead of toggling when being triggered.

    Returns boolean

  • set buttonMode(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

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

    Returns string

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

    • value: string

    Returns void

  • get colorMode(): boolean
  • Whether the sensor will only activate when a block of a certain color is sensed.

    Returns boolean

  • set colorMode(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get filterColor(): string
  • The color to filter for if colorMode is true.

    Returns string

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

    • value: string

    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

  • Attempts to convert a Child to a SensorPart. Only returns if the Child's file object is a SensorPart.

    Returns

    The converted SensorPart, or undefined if the Child is not a SensorPart.

    Parameters

    • potential: Child

      The Child to convert.

    Returns undefined | SensorPart

  • Creates a sensor.

    Returns

    The created sensor.

    Parameters

    • position: Vector3

      The position of the sensor.

    • rotation: Axis

      The rotation of the sensor.

    • Optional color: string

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

    • range: number = 10

      The range of the sensor. Defaults to 10.

    • audioEnabled: boolean = false

      Whether the sensor plays audio when activated. Defaults to false.

    • buttonMode: boolean = true

      Whether the sensor will only be active while sensing, instead of toggling when being triggered. Defaults to true.

    • colorMode: boolean = false

      Whether the sensor will only activate when a block of a certain color is sensed. Defaults to false.

    • filterColor: string = "FFFFFF"

      The color to filter for if colorMode is true. Defaults to "FFFFFF".

    Returns SensorPart

Generated using TypeDoc