Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. void GroundCheck()
  2. {
  3. RaycastHit hit;
  4. float distance = 1f;
  5. Vector3 dir = new Vector3(0, -1);
  6.  
  7. if(Physics.Raycast(transform.position, dir, out hit, distance))
  8. {
  9. isGrounded = true;
  10. }
  11. else
  12. {
  13. isGrounded = false;
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement