Advertisement
Guest User

grounded setting

a guest
Apr 25th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.32 KB | None | 0 0
  1. private void OnCollisionEnter2D(Collision2D collision)
  2.     {
  3.         if (collision.gameObject.layer == 8){
  4.             grounded = true;
  5.         }
  6.  
  7.     }
  8.  
  9.     private void OnCollisionExit2D(Collision2D collision)
  10.     {
  11.         if (collision.gameObject.layer == 8)
  12.         {
  13.             grounded = false;
  14.         }
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement