Class
SensorBase
NotCreatable
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#
UpdateTypeSensorUpdateType | Determines 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#
| Sense | Recomputes 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#
| OnSensorOutputChanged | Fires 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
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild
Subclasses 4#
AtmosphereSensor, BuoyancySensor, ControllerSensor, FluidForceSensor