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); }
public void AddVelocity() { controller.DisableClamping(); controller.DisableSlopeLimit(); moveDirection = (controller.up * CalculateJumpSpeed(JumpHeight, Gravity)); //currentState = PlayerStates.Fall; return; }
private void Jump_EnterState() { superCharacterController.DisableClamping(); superCharacterController.DisableSlopeLimit(); currentVelocity += superCharacterController.up * CalculateJumpSpeed(jumpHeight, gravity); canJump = false; CmdJump(); }
void Jump_EnterState() { controller.DisableClamping(); controller.DisableSlopeLimit(); this.Animator.SetBool("Jump", true); this.StartCoroutine(DisableBool("Jump", 0.1f)); }
void Jump_EnterState() { superCharacterController.DisableClamping(); superCharacterController.DisableSlopeLimit(); currentVelocity += superCharacterController.up * CalculateJumpSpeed(jumpHeight, gravity); canJump = false; animator.SetInteger("Jumping", 1); animator.SetTrigger("JumpTrigger"); }
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"); }
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); } }