Skip to main content

ArcSensor

Detects objects intersected by an arc. Subclass of Sensor.

Properties

Parameterisation

One of Bezier or Ballistic. See manual.

Bezier

Values for the Bezier Curve parameterisation.

Ballistic

Values for the Ballistic Curve parameterisation.

WorldSpace

Is the curve parameterised in world space or local space.

DetectsOnLayers

A layer mask specifying which physics layers objects will be detected on.

ObstructedByLayers

A layer mask specifying which physics layers objects will obstruct the ray on.

DetectionMode

  • Colliders - sensor will detect the Collider.gameObject.
  • RigidBodies - sensor will detect the Collider.attachedRigidBody.gameObject.

Filter

Configuration for filters including Ignore List and Tag Filter.

IgnoreTriggerColliders

Ignores all trigger colliders. Will not detect them or be obstructed by them.

PulseMode

One of EachFrame, FixedInterval or Manual.

PulseInterval

If PulseMode is set to FixedInterval, this is the time in seconds between each pulse.

IsObstructed

Boolean specifying if the ray is currently obstructed.

Events

OnObstruction

UnityEvent<IObstructionSensor> invoked when the sensor is obstructed and was previously unobstructed.

OnClear

UnityEvent<IObstructionSensor> invoked when the sensor becomes unobstructed when it was previously obstructed.

Methods

GetDetectionRayHit(gameObject)

RayHit GetDetectionRayHit(GameObject detectedGameObject)
Returns the RayHit data for the given detected GameObject.

GetObstructionRayHit()

RayHit GetObstruction()
Returns RayHit data for the current obstruction.