diff --git a/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/WallRun.cs b/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/WallRun.cs index cc36714..8e273b6 100644 --- a/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/WallRun.cs +++ b/Assets/Scripts/PlayerScripts/PlayerItems/ItemScripts/WallRun.cs @@ -27,6 +27,7 @@ public class WallRun : NetworkBehaviour RaycastHit[] hits; bool isWallRunning = false; + public bool firstAttach = false; Vector3 lastWallPosition; Vector3 lastWallNormal; float elapsedTimeSinceJump = 0; @@ -66,7 +67,7 @@ public class WallRun : NetworkBehaviour public void WallRunRoutine() { - if (!IsLocalPlayer) { return; } + //if (!IsLocalPlayer) { return; } isWallRunning = false; @@ -173,7 +174,11 @@ public class WallRun : NetworkBehaviour // playerMovementController.SetPlayerVelocity(moveToSet); - isWallRunning = true; + if(!isWallRunning){ + firstAttach = true; + isWallRunning = true; + } + if(playerMovementController.curJumpNum == playerMovementController.pStats.JumpNum){ playerMovementController.curJumpNum = 0; } diff --git a/Assets/Scripts/PlayerScripts/PlayerMovement.cs b/Assets/Scripts/PlayerScripts/PlayerMovement.cs index e3fe0d9..87810df 100644 --- a/Assets/Scripts/PlayerScripts/PlayerMovement.cs +++ b/Assets/Scripts/PlayerScripts/PlayerMovement.cs @@ -445,6 +445,10 @@ public class PlayerMovement : NetworkBehaviour //if wallrunning apply different gravity if(wallRun.IsWallRunning()){ + if(wallRun.firstAttach){ + g = 0; + wallRun.firstAttach = false; + } GravityCalculation(2); }