edited some player data to make grapple and jump feel better

This commit is contained in:
slevy14
2023-04-29 18:22:26 -07:00
parent 3318e11fd1
commit dd3d1386be
6 changed files with 217 additions and 20 deletions

View File

@@ -46,6 +46,7 @@ public class PlayerMovement : MonoBehaviour
public float LastPressedJumpTime { get; private set; }
Tutorial_GrapplingRope grapplingRope;
bool wasGrappling = false;
//Set all of these up in the inspector
[Header("Checks")]
@@ -114,6 +115,7 @@ public class PlayerMovement : MonoBehaviour
{
LastOnGroundTime = Data.coyoteTime; //if so sets the lastGrounded to coyoteTime
trumpet = 2;
wasGrappling = false;
}
//Right Wall Check
@@ -187,6 +189,14 @@ public class PlayerMovement : MonoBehaviour
// }
#endregion
#region GRAPPLE CHECKS
// set wasGrappling to true if the player starts grappling
if (grapplingRope.isGrappling) {
wasGrappling = true;
}
#endregion
#region SLIDE CHECKS
if (CanSlide() && ((LastOnWallLeftTime > 0 && _moveInput.x < 0) || (LastOnWallRightTime > 0 && _moveInput.x > 0)))
IsSliding = true;
@@ -280,10 +290,14 @@ public class PlayerMovement : MonoBehaviour
//Gets an acceleration value based on if we are accelerating (includes turning)
//or trying to decelerate (stop). As well as applying a multiplier if we're air borne.
if (LastOnGroundTime > 0)
if (LastOnGroundTime > 0) {
accelRate = (Mathf.Abs(targetSpeed) > 0.01f) ? Data.runAccelAmount : Data.runDeccelAmount;
else
}
else if (wasGrappling) {
accelRate = (Mathf.Abs(targetSpeed) > 0.01f) ? Data.runAccelAmount * Data.accelInAir : Data.runDeccelAmount * (Data.deccelInAir / 5);
} else {
accelRate = (Mathf.Abs(targetSpeed) > 0.01f) ? Data.runAccelAmount * Data.accelInAir : Data.runDeccelAmount * Data.deccelInAir;
}
#endregion
#region Add Bonus Jump Apex Acceleration

View File

@@ -24,7 +24,7 @@ MonoBehaviour:
runDecceleration: 2
runDeccelAmount: 14.285714
accelInAir: 0.5
deccelInAir: 0.05
deccelInAir: 0.2
doConserveMomentum: 1
jumpHeight: 2.25
jumpTimeToApex: 0.4