Guest User

Untitled

a guest
Feb 7th, 2021
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. private void FixedUpdate()
  2.     {
  3.         isGrounded = Physics2D.OverlapCircle(groundCheck.position, checkRadius, whatIsGround);
  4.  
  5.         if (JumpEnemy == false)
  6.         {
  7.             rb.velocity = new Vector2(Input.GetAxis("Horizontal") * speed, rb.velocity.y);
  8.         } else
  9.         {
  10.             JumpEnemy = false;
  11.         }
  12. ....
  13.     }
  14.  
  15.      private void OnTriggerEnter2D(Collider2D collision)
  16.     {
  17.        
  18.         if (this.CompareTag("Player") && collision.CompareTag("Damage"))
  19.         {
  20.             JumpEnemy = true;
  21.         }
  22. ...
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment