diff --git a/Assets/Scenes/Demos/MovementScene.unity b/Assets/Scenes/Demos/MovementScene.unity index 54d0815..9f3e5ed 100644 --- a/Assets/Scenes/Demos/MovementScene.unity +++ b/Assets/Scenes/Demos/MovementScene.unity @@ -2306,6 +2306,14 @@ PrefabInstance: propertyPath: hasGrapple value: 1 objectReference: {fileID: 0} + - target: {fileID: 6664667533527261801, guid: 6adb8bcc65ee3a54da64d7c65225f219, type: 3} + propertyPath: hasWallrun + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6664667533527262097, guid: 6adb8bcc65ee3a54da64d7c65225f219, type: 3} + propertyPath: maxGrappleDistance + value: 20 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 6adb8bcc65ee3a54da64d7c65225f219, type: 3} --- !u!1 &1493944130 diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dGrapplingHook.cs b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dGrapplingHook.cs index 86bafbd..6ac969c 100644 --- a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dGrapplingHook.cs +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugItems/dGrapplingHook.cs @@ -5,7 +5,8 @@ using UnityEngine; public class dGrapplingHook : NetworkBehaviour { - public float maxGrappleDistance = 18; + public float maxGrappleDistance = 20; + public float maxGrabDistance = 30; public bool isGrappled; private int hookPointIndex; @@ -73,8 +74,13 @@ public class dGrapplingHook : NetworkBehaviour { hookPoint = hookPoints[hookPointIndex]; //The point we are grappling from ropeLength = Vector3.Distance(gameObject.transform.position, hookPoint.transform.position); + if(ropeLength > maxGrappleDistance){ + ropeLength = maxGrappleDistance; + } + oldXZDir = (new Vector3(hookPoint.transform.position.x,0,hookPoint.transform.position.z) - new Vector3(transform.position.x,0,transform.position.z)).normalized; curXZDir = (new Vector3(hookPoint.transform.position.x,0,hookPoint.transform.position.z) - new Vector3(transform.position.x,0,transform.position.z)).normalized; + swingMom = CalculateSwingMom(playerMovement.driftVel.magnitude * 50f); oldSwingMom = swingMom; playerMovement.g = -1; @@ -124,7 +130,7 @@ public class dGrapplingHook : NetworkBehaviour //Calculate tether force direction based on hookpoint if (Vector3.Distance(gameObject.transform.position, hookPoint.transform.position) >= ropeLength ) { - + Debug.Log(ropeLength); forceDirection = CalculateForceDirection(1, playerMovement.g, hookPoint.transform.position) + RopeLengthOffset(hookPoint.transform.position, Vector3.Distance(gameObject.transform.position, hookPoint.transform.position)); @@ -179,7 +185,7 @@ public class dGrapplingHook : NetworkBehaviour //Finds the nearest hook to the player int FindHookPoint() { - float least = maxGrappleDistance; + float least = maxGrabDistance; int index = -1; for(int i = 0; i