Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. bool ground()
  2. {
  3.  
  4. float extraheight = .01f;
  5.  
  6. RaycastHit2D hit = Physics2D.Raycast(boxcollider2d.bounds.center, Vector2.down, boxcollider2d.bounds.extents.y + extraheight);
  7. if (hit.collider != null)
  8. return true;
  9. else
  10. return false;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement