Updated the non debug files

This commit is contained in:
Melbyj1125
2022-01-24 13:42:08 -06:00
parent 2da2237835
commit fca69d01d0
10 changed files with 131 additions and 26 deletions

View File

@@ -33,7 +33,10 @@ public class PlayerMovement : NetworkBehaviour
float curCoyJumpTimer; // current Coyote Jump time
public float lowJumpMultiplier; // Short jump multiplier
public float fallMultiplier; // High Jump Multiplier
public float g = 0; // the y velocity
//Gravity values
public float g = 0; // the y velocity affected by player Grav
private float maxG = -100; //The max downwards y velocity or g the player can have
//Glide Values
bool tempSet = false;
@@ -89,6 +92,7 @@ public class PlayerMovement : NetworkBehaviour
//Blink
private Blink blink;
//Grapple
private GrapplingHook grapple;
@@ -215,8 +219,14 @@ public class PlayerMovement : NetworkBehaviour
if(animator != null) animator.SetBool("isRunning", false);
}
//Move Player
moveController.Move(driftVel + (moveY * Time.deltaTime));
if(grapple.isGrappled) moveController.Move(grapple.forceDirection * Time.deltaTime);
if(grapple.isGrappled && !isGrounded){
moveController.Move(((moveY + grapple.forceDirection) * Time.deltaTime));
}
else{
moveController.Move(driftVel + (moveY * Time.deltaTime));
}
}
@@ -226,7 +236,7 @@ public class PlayerMovement : NetworkBehaviour
{
WallCheck();
//If nothing is pressed speed is 0
if ((Input.GetAxis("Vertical") == 0.0f && Input.GetAxis("Horizontal") == 0.0f) || isSliding)
if ((Input.GetAxis("Vertical") == 0.0f && Input.GetAxis("Horizontal") == 0.0f) || isSliding ||(grapple.isGrappled && !isGrounded))
{
pStats.CurVel = 0.0f;
return pStats.CurVel;
@@ -458,6 +468,11 @@ public class PlayerMovement : NetworkBehaviour
else{
g = 0;
}
//Caps out the players downwards speed
if(g < maxG){
g = maxG;
}
}