raycasthit2d
This is an old revision of the document!
RaycastHit2D can be used in an if statement to tell if the raycast hit anything, or if it hit nothing.
Example:
RaycastHit2D hit = Physics2D.Raycast(someStartPoint, someDirection);
if(hit) {
Debug.Log("yaaay I hit something!");
}
raycasthit2d.1620197842.txt.gz · Last modified: 2025/01/15 04:35 (external edit)