Пример #1
0
 public void Jump()
 {
     if (Physics.Raycast(transform.position - new Vector3(0.5f, 0, 0), Vector3.down, rayLength, 1 << 8) ||
         Physics.Raycast(transform.position + new Vector3(0.5f, 0, 0), Vector3.down, rayLength, 1 << 8))
     {
         myRigidbody.velocity = new Vector2(myRigidbody.velocity.x, jumpHeight);
         audioScript.JumpSound();
     }
 }