From dd27705eee681d4d0c074c9659704763db88a509 Mon Sep 17 00:00:00 2001 From: Melbyj1125 <60886701+Melbyj1125@users.noreply.github.com> Date: Wed, 2 Feb 2022 08:56:29 -0600 Subject: [PATCH] updated non debug files --- .../PlayerScripts/PlayerItems/ItemScripts/WallRun.cs | 9 +++++++-- Assets/Scripts/PlayerScripts/PlayerMovement.cs | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) 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); }