- Home /
Question by
Aytheta · Aug 07, 2018 at 12:35 AM ·
raycastcolliderstilemapraycasthit2d
Raycast issue with tilemap
Having issues getting a raycast to detect with a tilemap collider. Tilemaps is tagged as "Ground", and is on the same layer as the player. Any idea on a fix? Here is my code:
void PlayerRaycast ()
{
RaycastHit2D hit = Physics2D.Raycast (transform.position, Vector2.down);
if (hit.collider.tag == "Ground")
{
isGrounded = true;
}
}
Comment
Your answer
Follow this Question
Related Questions
RaycastHit2D hits "itself" 3 Answers
OnCollisionEnter2D is not working 0 Answers
Raycast2D not returning any transform instead keeps returning void. 1 Answer
RaycastHit Collider Question 1 Answer