Skip to content

Class · inherits Instance

SensorBase

Official docs ↗

An abstract class for various sensor instance types.

About SensorBase

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

  • UpdateType: SensorUpdateTypeDetermines how the sensor will update its output data.

    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.

Events 1

  • OnSensorOutputChangedSensorBase.OnSensorOutputChanged:Connect(function())Fires when one of the sensor's output properties changes value.

    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.

SensorBase also has every member of Instance. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.