mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 18:04:27 -05:00
Wallrun allows players to hop off wall again
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user