private void Move() { var absVelX = Mathf.Abs(rigidbody.velocity.x); var absVelY = Mathf.Abs(rigidbody.velocity.y); standing = (absVelY <= standingThreshold) ? true : false; var forceX = 0f; var forceY = 0f; Debug.Log("absVelY = " + absVelY + " / absVelX = " + absVelX); // Debug for Testing if (controller.GetMoving().x != 0) { if (absVelX < maxVelocity.x) { var newSpeed = speed * controller.GetMoving().x; forceX = standing ? newSpeed : (newSpeed * airSpeedMultiplier); renderer.flipX = forceX < 0; } anim.SetInteger("AnimState", 1); } else { anim.SetInteger("AnimState", 0); } if (controller.GetMoving().y > 0) { if (absVelY < maxVelocity.y) { forceY = jetSpeed * controller.GetMoving().y; } anim.SetInteger("AnimState", 2); } else if (absVelY > 0 && !standing) { anim.SetInteger("AnimState", 3); } rigidbody.AddForce(new Vector2(forceX, forceY)); } // Move Method