- Home /
Character falls over and bugs out when animator is enabled
My animations were animated in unity with my rigged character. I have setup my animations to run on a integer condition and that is all working. I added a jumping function and when I jump my character freaks out. It only happens when the animator is enabled and I can't figure this out. Please help. My jump does not have an animation made for it yet, right now its just idle and walk.
With animator: https://gyazo.com/283c6b657febca9f860b6a75b9c8fe92
Without animator: https://gyazo.com/3b2aee7f85548f70e33cf7ada68252af
Jump code: float yStore = moveDirection.y; moveDirection = StickToWorldspace(new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"))); moveDirection = moveDirection.normalized moveSpeed; moveDirection.y = yStore; if (charController.isGrounded) { if (Input.GetButton("Jump")) { moveDirection.y = jumpSpeed; } } moveDirection.y -= gravity Time.deltaTime; yStore = moveDirection.y; Vector3 destination = moveDirection moveSpeed Time.deltaTime; if (destination != Vector3.zero) { charController.Move(destination); }