Fixed an issue with wallrun moving the player up

Still needs adjustments to be more flexible and maybe allow the player
to wall run from standing still to allow for vertical wallrun sections.
This commit is contained in:
Melbyj1125
2022-02-02 08:48:30 -06:00
parent f683a48b84
commit df1b7f5448
4 changed files with 16 additions and 3 deletions

View File

@@ -27,6 +27,7 @@ public class dWallRun : NetworkBehaviour
RaycastHit[] hits;
bool isWallRunning = false;
public bool firstAttach = false;
Vector3 lastWallPosition;
Vector3 lastWallNormal;
float elapsedTimeSinceJump = 0;
@@ -173,7 +174,11 @@ public class dWallRun : NetworkBehaviour
//
playerMovementController.SetPlayerVelocity(moveToSet);
isWallRunning = true;
if(!isWallRunning){
firstAttach = true;
isWallRunning = true;
}
if(playerMovementController.curJumpNum == playerMovementController.pStats.JumpNum){
playerMovementController.curJumpNum = 0;
}

View File

@@ -445,6 +445,10 @@ public class dPlayerMovement : NetworkBehaviour
//if wallrunning apply different gravity
if(wallRun.IsWallRunning()){
if(wallRun.firstAttach){
g = 0;
wallRun.firstAttach = false;
}
GravityCalculation(2);
}