Skip to main content

Sensor

Description:

  A class to represent a physics sensor object in the game world.

Class Object: Sensor Class.

Inherits from: Object.

enabled

Type: Field.

Description:

  Whether the sensor is currently enabled or not.

Signature:

enabled: boolean

tag

Type: Readonly Field.

Description:

  The tag for the sensor.

Signature:

const tag: integer

owner

Type: Readonly Field.

Description:

  The "Body" object that owns the sensor.

Signature:

const owner: Body

sensed

Type: Readonly Field.

Description:

  Whether the sensor is currently sensing any other "Body" objects in the game world.

Signature:

const sensed: boolean

sensedBodies

Type: Readonly Field.

Description:

  An array of "Body" objects that are currently being sensed by the sensor.

Signature:

const sensedBodies: Array

contains

Type: Function.

Description:

  Determines whether the specified "Body" object is currently being sensed by the sensor.

Signature:

contains: function(self: Sensor, body: Body): boolean

Parameters:

ParameterTypeDescription
bodyBodyThe "Body" object to check if it is being sensed.

Returns:

Return TypeDescription
booleanTrue if the "Body" object is being sensed by the sensor, false otherwise.