private void FixedUpdate() { FixedUpdateSubComponent(SubComponents.LEDGECHECKER); if (!animationProgress.CancelPull) { if (RIGID_BODY.velocity.y > 0f && !Jump) { RIGID_BODY.velocity -= (Vector3.up * RIGID_BODY.velocity.y * 0.1f); } } animationProgress.UpdatingSpheres = false; UpdateBoxCollider_Size(); UpdateBoxCollider_Center(); if (animationProgress.UpdatingSpheres) { collisionSpheres.Reposition_FrontSpheres(); collisionSpheres.Reposition_BottomSpheres(); collisionSpheres.Reposition_BackSpheres(); collisionSpheres.Reposition_UpSpheres(); if (animationProgress.IsLanding) { //Debug.Log("repositioning y"); RIGID_BODY.MovePosition(new Vector3( 0f, animationProgress.LandingPosition.y, this.transform.position.z)); } } if (animationProgress.RagdollTriggered) { TurnOnRagdoll(); animationProgress.RagdollTriggered = false; } //slow down wallslide if (animationProgress.MaxFallVelocity.y != 0f) { if (RIGID_BODY.velocity.y <= animationProgress.MaxFallVelocity.y) { RIGID_BODY.velocity = animationProgress.MaxFallVelocity; } } }
private void FixedUpdate() { if (!animationProgress.CancelPull) { if (RIGID_BODY.velocity.y > 0f && !Jump) { RIGID_BODY.velocity -= (Vector3.up * RIGID_BODY.velocity.y * 0.1f); } } animationProgress.UpdatingSpheres = false; UpdateBoxCollider_Size(); UpdateBoxCollider_Center(); if (animationProgress.UpdatingSpheres) { collisionSpheres.Reposition_FrontSpheres(); collisionSpheres.Reposition_BottomSpheres(); collisionSpheres.Reposition_BackSpheres(); collisionSpheres.Reposition_UpSpheres(); } if (animationProgress.RagdollTriggered) { TurnOnRagdoll(); animationProgress.RagdollTriggered = false; } //slow down wallslide if (animationProgress.MaxFallVelocity.y != 0f) { if (RIGID_BODY.velocity.y <= animationProgress.MaxFallVelocity.y) { RIGID_BODY.velocity = animationProgress.MaxFallVelocity; } } }