If I add "&& Hit.collider.tag" part to my function it wouldn't work, I check if the object desired is properly tagged and it was.
void Raycast()
{
RaycastHit2D Hit = Physics2D.Raycast (transform.position, Vector2.down );
if (Hit.distance < 0.9f && Hit.collider.tag == "ground")
{
Debug.Log("dd");
}
}
↧