From df1b7f544845699bb84c7b065ed2893290165713 Mon Sep 17 00:00:00 2001 From: Melbyj1125 <60886701+Melbyj1125@users.noreply.github.com> Date: Wed, 2 Feb 2022 08:48:30 -0600 Subject: [PATCH] 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. --- Assets/Scenes/Demos/MovementScene.unity | 4 ++++ .../PlayerScripts/DebugPlayer/DebugItems/dWallRun.cs | 7 ++++++- .../Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs | 4 ++++ UserSettings/EditorUserSettings.asset | 4 ++-- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Assets/Scenes/Demos/MovementScene.unity b/Assets/Scenes/Demos/MovementScene.unity index 1967055..463a045 100644 --- a/Assets/Scenes/Demos/MovementScene.unity +++ b/Assets/Scenes/Demos/MovementScene.unity @@ -2322,6 +2322,10 @@ PrefabInstance: propertyPath: traction value: 5 objectReference: {fileID: 0} + - target: {fileID: 6664667533527261801, guid: 6adb8bcc65ee3a54da64d7c65225f219, type: 3} + propertyPath: hasWallrun + value: 1 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 6adb8bcc65ee3a54da64d7c65225f219, type: 3} --- !u!1 &1493944130 diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dWallRun.cs b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dWallRun.cs index 2176524..e8d655c 100644 --- a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dWallRun.cs +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dWallRun.cs @@ -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; } diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs b/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs index 1f14d6d..ca85db3 100644 --- a/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/dPlayerMovement.cs @@ -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); } diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index 001c21a..9678d48 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -15,13 +15,13 @@ EditorUserSettings: value: 22424703114646680e0b0227036c6f1f05033f2b212d68252320092a flags: 0 RecentlyUsedScenePath-3: - value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb + value: 22424703114646680e0b0227036c78111b125507233d28242c20137df7ee3d2cfb flags: 0 RecentlyUsedScenePath-4: value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb flags: 0 RecentlyUsedScenePath-5: - value: 22424703114646680e0b0227036c78111b125507233d28242c20137df7ee3d2cfb + value: 22424703114646680e0b0227036c7b151b180b6501273035202c1327d1e33136e7a923e7ee2e26 flags: 0 RecentlyUsedScenePath-6: value: 22424703114646680e0b0227036c7b151b180b6501273035202c1327d1e33136e7a923e7ee2e26