SequentialCollisionDetector

February 9, 2024 ยท View on GitHub

Namespace: Unity.TinyCharacterController.Utility


Summary:

SequentialCollisionDetector is a custom component for Unity, designed to perform collision detection using multiple detection points in a step-by-step manner. This is especially useful for scenarios where characters or objects in a game need to detect collisions with other objects using multiple partial detection areas.

Features and Operation:

  • Multiple Detection Points: Utilizes multiple detection points for more precise collision detection.
  • Step-by-Step Collision Detection: Performs collision detection in phases for more accurate results.
  • Visualization of Detection Range: Visually displays the detection range in the editor for easier debugging.

Properties

NameDescription
TimingThe timing for collision detection.
OwnerThe owner of this component.
CacheTargetTypeThe type of the cached target.
HitLayerThe layer used for collision detection.
HitTagsArray of tags for which collision detection is performed.
OnHitObjectsEvent triggered when colliding with objects.
_frameThe detection frame range.
_hitPositionsConfiguration of detection positions and their effective ranges.

Methods

  • There are no public methods.

Additional Notes

  • SequentialCollisionDetector inherits from CollisionDetectorBase, providing fundamental functionalities for collision detection.
  • By setting collision data (CollisionData) for each detection point, the detection range can be finely controlled.
  • The settings for the detection range and detection frame can be intuitively adjusted within the editor, facilitating the tuning of collision detection behavior in actual gameplay.