mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 18:04:27 -05:00
grapple is more consistent and has a better momentum fall off on release
This commit is contained in:
@@ -5,7 +5,7 @@ using UnityEngine;
|
||||
|
||||
public class dGrapplingHook : NetworkBehaviour
|
||||
{
|
||||
public float maxGrappleDistance = 15;
|
||||
public float maxGrappleDistance = 18;
|
||||
|
||||
public bool isGrappled;
|
||||
private int hookPointIndex;
|
||||
@@ -114,9 +114,9 @@ public class dGrapplingHook : NetworkBehaviour
|
||||
if (Input.GetKey(KeyCode.RightShift) || Input.GetKey(KeyCode.JoystickButton5))
|
||||
{
|
||||
ropeLength -= climbRate * Time.deltaTime;
|
||||
if (ropeLength < 5)
|
||||
if (ropeLength < 8)
|
||||
{
|
||||
ropeLength = 5;
|
||||
ropeLength = 8;
|
||||
}
|
||||
//Debug.Log(ropeLength.ToString());
|
||||
}
|
||||
@@ -155,7 +155,9 @@ public class dGrapplingHook : NetworkBehaviour
|
||||
swingback = true;
|
||||
|
||||
if(release){
|
||||
lerpRelease = Vector3.Lerp(lerpRelease, tempRelease, 10 * Time.deltaTime);
|
||||
lerpRelease = Vector3.Lerp(lerpRelease, tempRelease, 10f * Time.deltaTime);
|
||||
tempRelease *= .99f;
|
||||
Debug.Log(lerpRelease);
|
||||
movementController.Move(lerpRelease);
|
||||
}
|
||||
|
||||
@@ -304,7 +306,9 @@ public class dGrapplingHook : NetworkBehaviour
|
||||
}
|
||||
|
||||
Vector3 CalculateSwingReleaseForce(){
|
||||
Vector3 releaseSwingForceDirection = momDirection * (swingMom + 20);
|
||||
|
||||
Vector3 releaseSwingForceDirection = momDirection * ((swingMom) + 10);
|
||||
|
||||
releaseSwingForceDirection = new Vector3(releaseSwingForceDirection.x,0,releaseSwingForceDirection.z);
|
||||
|
||||
if(swingMom < 5){
|
||||
|
||||
Reference in New Issue
Block a user