HOW DO I USE RAYCASTHIT 2D????

I can’t use Raycast Hit 2d in my game and I need it but the function won’t take it!!!

WHAT DO I DO?

Here’s my script:

	RaycastHit2D hit;

		if(Physics2D.Raycast(this.gameObject.transform.position, Vector2.right, groundDistance / 100, out hit))
		{

                  
		


		}

Physics2D.Raycast works differently from Physics.Raycast. So check the example in the docs.