I have got problem after updating to Unity 5.1 from Unity 5.0 . In Unity 5.0 went everything well but after updating to 5.1 the problem started. My player character started to stuck after jump. I do not know how to solve this problem. I was looking in other answers but I haven´t found any answer. For the first, player jumps and when grounds he gets stuck and can´t move forward or jump. Here is my code.
void FixedUpdate() {
grounded = Physics2D.OverlapCircle (groundCheck.position, groundRadius, whatIsGround);
anim.SetBool ("Ground", grounded);
anim.SetFloat ("vSpeed", rb2D.velocity.y);
}
void Update() {
if (grounded && Input.GetKeyDown (KeyCode.Space)) {
anim.SetBool ("Ground", false);
rb2D.AddForce (Vector2.up * jumpForce_upward, ForceMode2D.Force);
}
///
///movement
///
if (grounded && Input.GetAxis ("Horizontal") >= 0 && !fallen) {
move = Input.GetAxis ("Horizontal") + 0.3f;
} else if (fallen) {
fall = 0;
}
movement = fall * (move);
anim.SetFloat ("speed", move);
rb2D.velocity = new Vector2 (movement * 40f, rb2D.velocity.y);
}
}