DisableSlopeLimit() 공개 메소드

public DisableSlopeLimit ( ) : void
리턴 void
예제 #1
0
    void Jump_EnterState()
    {
        controller.DisableClamping();
        controller.DisableSlopeLimit();

        moveDirection += controller.up * CalculateJumpSpeed(JumpHeight, Gravity);
    }
 void Jump_EnterState()
 {
     controller.DisableClamping();
     controller.DisableSlopeLimit();
     //cameraObject.SendMessage("setCameraPositionJumpView");
     anim.SetBool("Jump", true);
     moveDirection += controller.up * CalculateJumpSpeed(JumpHeight, Gravity);
 }
예제 #3
0
 public void AddVelocity()
 {
     controller.DisableClamping();
     controller.DisableSlopeLimit();
     moveDirection = (controller.up * CalculateJumpSpeed(JumpHeight, Gravity));
     //currentState = PlayerStates.Fall;
     return;
 }
예제 #4
0
 private void Jump_EnterState()
 {
     superCharacterController.DisableClamping();
     superCharacterController.DisableSlopeLimit();
     currentVelocity += superCharacterController.up * CalculateJumpSpeed(jumpHeight, gravity);
     canJump          = false;
     CmdJump();
 }
예제 #5
0
    void Jump_EnterState()
    {
        controller.DisableClamping();
        controller.DisableSlopeLimit();

        this.Animator.SetBool("Jump", true);
        this.StartCoroutine(DisableBool("Jump", 0.1f));
    }
예제 #6
0
 void Jump_EnterState()
 {
     superCharacterController.DisableClamping();
     superCharacterController.DisableSlopeLimit();
     currentVelocity += superCharacterController.up * CalculateJumpSpeed(jumpHeight, gravity);
     canJump          = false;
     animator.SetInteger("Jumping", 1);
     animator.SetTrigger("JumpTrigger");
 }
예제 #7
0
        private void Jump_EnterState()
        {
            superCharacterController.DisableClamping();
            superCharacterController.DisableSlopeLimit();

            currentVelocity = new Vector3(currentVelocity.x, jumpSpeed, currentVelocity.z);

            animator.SetInteger("Jumping", 1);
            rpgCharacterController.SetAnimatorTrigger(AnimatorTrigger.JumpTrigger);
            canJump = false;
        }
    void Jump_EnterState()
    {
        controller.DisableClamping();
        controller.DisableSlopeLimit();

        if (IsDashing() || input.Current.DashInput)
        {
            isDashJump = true;
        }

        moveDirection.y = 0;
        moveDirection  += controller.up * CalculateJumpSpeed(JumpHeight, Gravity);
    }
 private void Jump_EnterState()
 {
     superCharacterController.DisableClamping();
     superCharacterController.DisableSlopeLimit();
     currentVelocity += superCharacterController.up * CalculateJumpSpeed(jumpHeight, gravity);
     //Set weaponstate to Unarmed if Relaxed.
     if (rpgCharacterController.weapon == Weapon.RELAX)
     {
         rpgCharacterController.weapon = Weapon.UNARMED;
         animator.SetInteger("Weapon", 0);
     }
     canJump = false;
     animator.SetInteger("Jumping", 1);
     animator.SetTrigger("JumpTrigger");
 }
예제 #10
0
        private void Jump_EnterState()
        {
            superCharacterController.DisableClamping();
            superCharacterController.DisableSlopeLimit();

            if ((RPGCharacterState)lastState == RPGCharacterState.Swim)
            {
                currentVelocity = new Vector3(currentVelocity.x, strokeSpeed, currentVelocity.z);
            }
            else
            {
                currentVelocity = new Vector3(currentVelocity.x, jumpSpeed, currentVelocity.z);
            }
            animator.SetInteger("Jumping", 1);
            rpgCharacterController.SetAnimatorTrigger(AnimatorTrigger.JumpTrigger);
            canJump = false;
        }
    void Jump_EnterState()
    {
        jumpCount++;

        //Maybe another way to implement this?
        momentum += 0.25f;
        print("momentum: " + momentum);

        controller.DisableClamping();
        controller.DisableSlopeLimit();

        walkSpeedAtJump = WalkSpeed;

        //Walljump
        print("iswalljumping" + isWallJumping + "colliding: " + controller.collisionData.Count);

        if (isWallJumping && controller.collisionData.Count > 0)
        {
            //May want to separate horizontal and vertical components for better control

            //If planar speed is low, inrease it to a minimum
            if (Vector3.ProjectOnPlane(moveDirection, Vector3.up).magnitude < 20)
            {
                moveDirection    = Vector3.ProjectOnPlane(moveDirection, Vector3.up).normalized *(originalWalkspeed + extraWallRunSpeed / 2) + new Vector3(0, moveDirection.y, 0);
                JumpAcceleration = reducedJumpAcceleration;
                reducedTime      = 0.4f;
            }

            //Direction of jump
            moveDirection = Vector3.Reflect(moveDirection, controller.collisionData[0].normal);
            float angle = Vector3.Angle(Math3d.ProjectVectorOnPlane(controller.up, moveDirection), controller.collisionData[0].normal);
            print("angle between movedirection and wall normal: " + angle);

            if (angle > 40f)
            {
                Vector3 tempMoveDirection = moveDirection;
                moveDirection = Quaternion.AngleAxis((angle - 40f), Vector3.up) * moveDirection;
                float newAngle = Vector3.Angle(Math3d.ProjectVectorOnPlane(controller.up, moveDirection), controller.collisionData[0].normal);

                if (newAngle > 40)
                {
                    tempMoveDirection = Quaternion.AngleAxis(-(angle - 40f), Vector3.up) * tempMoveDirection;
                    moveDirection     = tempMoveDirection;
                    newAngle          = Vector3.Angle(Math3d.ProjectVectorOnPlane(controller.up, moveDirection), controller.collisionData[0].normal);
                }
            }

            if (moveDirection.y < 0)
            {
                moveDirection.y = 0;
            }

            //Don't walljump too high
            if (moveDirection.y > 1)
            {
                moveDirection += controller.up * CalculateJumpSpeed(JumpHeight, Gravity) / (moveDirection.y);
            }
            else
            {
                moveDirection += controller.up * CalculateJumpSpeed(JumpHeight, Gravity) / 1.6f;
            }

            previousNonZeroLocalMovement = Vector3.ProjectOnPlane(moveDirection, Vector3.up).normalized;

            jumpCount     = 1;
            isWallJumping = false;
        }
        else
        //Regular jump
        {
            moveDirection += controller.up * CalculateJumpSpeed(JumpHeight, Gravity);
        }
    }