Wallrun allows players to hop off wall again

This commit is contained in:
Melbyj1125
2021-12-03 10:51:37 -06:00
parent 57385b47b4
commit 55885e2ef1
19 changed files with 59 additions and 101 deletions

View File

@@ -26,7 +26,7 @@ public class dPlayerMovement : NetworkBehaviour
private CharacterController moveController;
//Jump value
private int curJumpNum;
public int curJumpNum;
private bool jumpPressed;
bool tempSet = false;
float tempTraction = 0.0f;
@@ -261,7 +261,13 @@ public class dPlayerMovement : NetworkBehaviour
//If space is pressed apply an upwards force to the player
if (Input.GetAxis("Jump") != 0 && !jumpPressed && curJumpNum + 1 < pStats.JumpNum && !isSliding)
{
AddImpact(transform.up, pStats.JumpPow);
if(wallRun.IsWallRunning()){
AddImpact((wallRun.GetWallJumpDirection()), pStats.JumpPow);
}
else{
AddImpact(transform.up, pStats.JumpPow);
}
curJumpNum++;
jumpPressed = true;
}
@@ -357,6 +363,10 @@ public class dPlayerMovement : NetworkBehaviour
//Wallrunning
else if (pStats.HasWallrun) { wallRun.WallRunRoutine(); } //adjusted later if we are wallrunning
else{
vel.y -= pStats.PlayerGrav * Time.deltaTime;
}
//If gliding
//Go down slowly
}