isColliding property

bool get isColliding

Whether the object is currently colliding with another Collider or not.

Implementation

bool get isColliding {
  final propagatingCollisionBehavior =
      parent.findBehavior<PropagatingCollisionBehavior>();

  return propagatingCollisionBehavior.activeCollisions
      .map(propagatingCollisionBehavior._findEntity)
      .whereType<Collider>()
      .isNotEmpty;
}