Home > other >  [for]. How to utilize the Physics2D OverlapCicle whether character attacks hit
[for]. How to utilize the Physics2D OverlapCicle whether character attacks hit

Time:11-10

 int layer=LayerMask. NameToLayer (" Player "); 

 Collider2D is_hit=Physics2D. OverlapCircle (transform) position + new Vector3 (0, 0.5 f, 0), 1 f, layer); 

This method returns a Collider2D collision, if is a bool is simple, the collision body how to do? thank you

CodePudding user response:

Or is returned to the collision body into the circle within the scope of the need to detect? .
  • Related