void FixedUpdate() { if (grounded) { if (jumpFlag) { jumpFlag = false; SetLocalXVelocityToActualHorizontalSpeed(); rb.AddForce(transform.up * jumpSpeed * rb.mass, ForceMode2D.Impulse); } else { mover.ApplyMotion(); } } else if (isHanging) { //Debug.Log(Time.frameCount + " H"); rb.simulated = false; SetLocalVelocity(Vector2.zero); // climbing if (jumpFlag) { jumpFlag = false; Debug.LogWarning(Time.frameCount + " J"); physicsCollider.enabled = false; // Hm. transform.DOMove(toClimbRelativePos.position, climbingTime, false).OnComplete(() => { physicsCollider.enabled = true; rb.simulated = true; }); } } else { jumpFlag = false; rb.simulated = true; // let him fall, if he was hanging before } }