Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


CanContact(Collider2D)

This method determines if both Colliders can ever come into contact.
Read time 1 minuteLast updated 10 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.Physics2DModule
public bool CanContact(Collider2D collider)

Parameters

collider

The other Collider that is to be checked to see if it can contact the current Collider.

Returns

Type

Description

boolReturns
true
if both Colliders can contact each other otherwise
false
indicating that they cannot contact each other.

Remarks

Determining if Colliders can come into contact involves multiple checks including: