private void FixedUpdate() { if (dead) { //donothing return; } if (sliding) { //donothing return; } if (!climbing) { rb.velocity = new Vector2(m_horizontal * m_speed, rb.velocity.y); if (m_axis_jump > 0 && !jumping && !hasJumped) { rb.AddForce(Vector2.up * m_Jump_force, ForceMode2D.Impulse); jumping = true; hasJumped = true; animator.SetBool("Jumping", true); Debug.Log("ho saltato"); } } else { if (m_axis_jump > 0) { rb.gravityScale = 2; rb.AddForce(Vector2.up * m_Jump_force, ForceMode2D.Impulse); jumping = true; hasJumped = true; climbing = false; animator.SetFloat("Vertical", 0f); animator.SetBool("Jumping", true); animator.SetBool("Climbing", false); if (ladder != null) { ladder.ActivatePlatform(); } return; } rb.velocity = new Vector2(0, m_vertical * m_climbing_speed); animator.SetFloat("Vertical", Mathf.Abs(m_vertical)); } }