Roblox UtilitiesDevlHub Roblox Documentation

Class

SensorBase

NotCreatable
Inherits
Instance › Object
Memory category
Instances
Subclasses
4

An abstract class for various sensor instance types.

A SensorBase is an instance that, when parented to a BasePart, outputs additional data about the world around that part. Often, other systems will consume the sensor's output data.

Properties 1#

UpdateTypeSensorUpdateTypeDetermines how the sensor will update its output data.ReadSafe

UpdateType: SensorUpdateType#

ReadSafe

Determines how the sensor will update its output data.

With SensorUpdateType.OnRead, internal sensor logic is run so that the output properties are always up to date. In this mode, the sensor will only run if you read the properties and they are currently outdated.

With SensorUpdateType.Manual, the output properties will never change. Instead, you can write your own scripts to set the output properties as you like.

Methods 1#

SenseRecomputes the sensor's output properties immediately.Deprecated

Sense(): ()#

DeprecatedDeprecated

Deprecated. This method should not be used in new work.

Recomputes the sensor's output properties immediately.

This method is deprecated and should not be used in new work. When UpdateType is SensorUpdateType.OnRead (the default), the sensor recalculates its output properties automatically the next time you read them, so calling this method is unnecessary. When UpdateType is SensorUpdateType.Manual, the outputs are never recomputed automatically; set the output properties yourself rather than calling this method.

Returns
  • ()

Events 1#

OnSensorOutputChangedFires when one of the sensor's output properties changes value.

OnSensorOutputChanged()#

Fires when one of the sensor's output properties changes value. The event carries no arguments; read the relevant output property to get its new value.

A sensor only recomputes its outputs while UpdateType is SensorUpdateType.OnRead (the default), so with the default update type this event fires as the outputs are recalculated on read. When UpdateType is SensorUpdateType.Manual, the outputs — and therefore this event — change only when you set the output properties yourself.

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed

Subclasses 4#