mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-04-26 02:00:54 -05:00
Merge branch 'sprintV7Melby'
This commit is contained in:
commit
fff8f4f17e
|
|
@ -3639,8 +3639,8 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: addc2e37ff81c1b4989ec34b6150b4f7, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
maxVel: 50
|
||||
minVel: 20
|
||||
maxVel: 45
|
||||
minVel: 15
|
||||
curVel: 0
|
||||
hardCapMaxVel: 90
|
||||
acc: 0.02
|
||||
|
|
@ -3820,6 +3820,7 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
maxGrappleDistance: 25
|
||||
maxGrabDistance: 30
|
||||
isGrappled: 0
|
||||
ropeLength: 0
|
||||
forceDirection: {x: 0, y: 0, z: 0}
|
||||
|
|
|
|||
|
|
@ -301,15 +301,15 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: addc2e37ff81c1b4989ec34b6150b4f7, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
maxVel: 40
|
||||
maxVel: 45
|
||||
minVel: 15
|
||||
curVel: 0
|
||||
hardCapMaxVel: 90
|
||||
acc: 0.01
|
||||
acc: 0.02
|
||||
jumpPow: 60
|
||||
jumpNum: 2
|
||||
traction: 3
|
||||
kickPow: 500
|
||||
traction: 5
|
||||
kickPow: 300
|
||||
recovTime: 3
|
||||
playerGrav: 200
|
||||
hasBlink: 0
|
||||
|
|
@ -482,6 +482,7 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
maxGrappleDistance: 25
|
||||
maxGrabDistance: 30
|
||||
isGrappled: 0
|
||||
ropeLength: 0
|
||||
forceDirection: {x: 0, y: 0, z: 0}
|
||||
|
|
|
|||
|
|
@ -260,8 +260,8 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: addc2e37ff81c1b4989ec34b6150b4f7, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
maxVel: 50
|
||||
minVel: 20
|
||||
maxVel: 45
|
||||
minVel: 15
|
||||
curVel: 0
|
||||
hardCapMaxVel: 90
|
||||
acc: 0.02
|
||||
|
|
@ -427,6 +427,7 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
maxGrappleDistance: 25
|
||||
maxGrabDistance: 30
|
||||
isGrappled: 0
|
||||
ropeLength: 0
|
||||
forceDirection: {x: 0, y: 0, z: 0}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ Transform:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3514673100429458173}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.16, z: -0.11}
|
||||
m_LocalPosition: {x: 0, y: 0.39, z: -0.11}
|
||||
m_LocalScale: {x: 0.29999998, y: 0.29999998, z: 0.29999998}
|
||||
m_Children:
|
||||
- {fileID: 6234133119625404040}
|
||||
|
|
@ -300,8 +300,8 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: addc2e37ff81c1b4989ec34b6150b4f7, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
maxVel: 50
|
||||
minVel: 20
|
||||
maxVel: 45
|
||||
minVel: 15
|
||||
curVel: 0
|
||||
hardCapMaxVel: 90
|
||||
acc: 0.02
|
||||
|
|
@ -348,7 +348,7 @@ MonoBehaviour:
|
|||
vel: {x: 0, y: 0, z: 0}
|
||||
driftVel: {x: 0, y: 0, z: 0}
|
||||
curJumpNum: 0
|
||||
lowJumpMultiplier: 0.1
|
||||
lowJumpMultiplier: 0.001
|
||||
fallMultiplier: 1.6
|
||||
g: 0
|
||||
isGrounded: 0
|
||||
|
|
@ -356,7 +356,7 @@ MonoBehaviour:
|
|||
cam: {fileID: 7188906082643956516}
|
||||
minAngle: -30
|
||||
maxAngle: 30
|
||||
sensitivity: 301
|
||||
sensitivity: 200
|
||||
isSliding: 0
|
||||
--- !u!114 &273103334658887749
|
||||
MonoBehaviour:
|
||||
|
|
@ -406,7 +406,7 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
moveDirection: {x: 0, y: 0, z: 0}
|
||||
dashDistance: 10
|
||||
dashDistance: 15
|
||||
dashStoppingSpeed: 0.1
|
||||
dashItem: {fileID: 11400000, guid: 3156de54e455b4348b2a6e79383383b0, type: 2}
|
||||
--- !u!114 &3672942772524564832
|
||||
|
|
@ -422,6 +422,7 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
maxGrappleDistance: 25
|
||||
maxGrabDistance: 30
|
||||
isGrappled: 0
|
||||
ropeLength: 0
|
||||
forceDirection: {x: 0, y: 0, z: 0}
|
||||
|
|
|
|||
|
|
@ -1069,7 +1069,7 @@ Transform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 7
|
||||
m_RootOrder: 6
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &650550299
|
||||
GameObject:
|
||||
|
|
@ -1876,7 +1876,7 @@ Transform:
|
|||
m_LocalScale: {x: 5, y: 1, z: 5}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 6
|
||||
m_RootOrder: 5
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!136 &1181153603
|
||||
CapsuleCollider:
|
||||
|
|
@ -1943,7 +1943,7 @@ Transform:
|
|||
- {fileID: 360025848}
|
||||
- {fileID: 577483205}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 9
|
||||
m_RootOrder: 8
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1257935739
|
||||
GameObject:
|
||||
|
|
@ -2229,7 +2229,7 @@ Transform:
|
|||
m_LocalScale: {x: 10, y: 10, z: 10}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 5
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!54 &1405946434
|
||||
Rigidbody:
|
||||
|
|
@ -2256,7 +2256,7 @@ PrefabInstance:
|
|||
m_Modifications:
|
||||
- target: {fileID: 297879044457584256, guid: 6adb8bcc65ee3a54da64d7c65225f219, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 8
|
||||
value: 7
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 297879044457584256, guid: 6adb8bcc65ee3a54da64d7c65225f219, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
|
|
@ -2264,7 +2264,7 @@ PrefabInstance:
|
|||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 297879044457584256, guid: 6adb8bcc65ee3a54da64d7c65225f219, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
value: 107
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 297879044457584256, guid: 6adb8bcc65ee3a54da64d7c65225f219, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
|
|
@ -2302,6 +2302,26 @@ PrefabInstance:
|
|||
propertyPath: m_Name
|
||||
value: DebugPlayerPrefab 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6664667533527261801, guid: 6adb8bcc65ee3a54da64d7c65225f219, type: 3}
|
||||
propertyPath: maxVel
|
||||
value: 45
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6664667533527261801, guid: 6adb8bcc65ee3a54da64d7c65225f219, type: 3}
|
||||
propertyPath: minVel
|
||||
value: 15
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6664667533527261801, guid: 6adb8bcc65ee3a54da64d7c65225f219, type: 3}
|
||||
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
|
||||
|
|
@ -2375,7 +2395,7 @@ Transform:
|
|||
- {fileID: 573469552}
|
||||
- {fileID: 1608019103}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 10
|
||||
m_RootOrder: 9
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1608019102
|
||||
GameObject:
|
||||
|
|
@ -2662,6 +2682,118 @@ MeshFilter:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1659307010}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!1 &1709217277
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1709217282}
|
||||
- component: {fileID: 1709217281}
|
||||
- component: {fileID: 1709217280}
|
||||
- component: {fileID: 1709217279}
|
||||
- component: {fileID: 1709217278}
|
||||
m_Layer: 0
|
||||
m_Name: Sphere (1)
|
||||
m_TagString: HookPoint
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!54 &1709217278
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1709217277}
|
||||
serializedVersion: 2
|
||||
m_Mass: 1
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0.05
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 1
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 0
|
||||
m_CollisionDetection: 0
|
||||
--- !u!135 &1709217279
|
||||
SphereCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1709217277}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 0
|
||||
serializedVersion: 2
|
||||
m_Radius: 0.5
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!23 &1709217280
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1709217277}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!33 &1709217281
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1709217277}
|
||||
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &1709217282
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1709217277}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 110.6, y: 24.5, z: 13.7}
|
||||
m_LocalScale: {x: 10, y: 10, z: 10}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 10
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1781357367
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -2978,68 +3110,3 @@ MeshFilter:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2061208975}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!1001 &6150409027306451727
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 6150409028514810266, guid: b95800967feee2a46a6c25838eb2fc6c, type: 3}
|
||||
propertyPath: m_CollisionDetection
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6150409029086178024, guid: b95800967feee2a46a6c25838eb2fc6c, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6150409029086178024, guid: b95800967feee2a46a6c25838eb2fc6c, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -6.95
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6150409029086178024, guid: b95800967feee2a46a6c25838eb2fc6c, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0.09
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6150409029086178024, guid: b95800967feee2a46a6c25838eb2fc6c, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 36.95
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6150409029086178024, guid: b95800967feee2a46a6c25838eb2fc6c, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6150409029086178024, guid: b95800967feee2a46a6c25838eb2fc6c, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6150409029086178024, guid: b95800967feee2a46a6c25838eb2fc6c, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6150409029086178024, guid: b95800967feee2a46a6c25838eb2fc6c, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6150409029086178024, guid: b95800967feee2a46a6c25838eb2fc6c, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6150409029086178024, guid: b95800967feee2a46a6c25838eb2fc6c, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6150409029086178024, guid: b95800967feee2a46a6c25838eb2fc6c, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6150409029086178026, guid: b95800967feee2a46a6c25838eb2fc6c, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Gate
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6150409029095057616, guid: b95800967feee2a46a6c25838eb2fc6c, type: 3}
|
||||
propertyPath: m_CollisionDetection
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: b95800967feee2a46a6c25838eb2fc6c, type: 3}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ using UnityEngine;
|
|||
|
||||
public class dGrapplingHook : NetworkBehaviour
|
||||
{
|
||||
public float maxGrappleDistance = 15;
|
||||
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;
|
||||
|
|
@ -114,9 +120,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());
|
||||
}
|
||||
|
|
@ -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));
|
||||
|
||||
|
||||
|
|
@ -155,7 +161,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);
|
||||
}
|
||||
|
||||
|
|
@ -177,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<hookPoints.Length; i++)
|
||||
{
|
||||
|
|
@ -304,7 +312,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){
|
||||
|
|
|
|||
|
|
@ -89,9 +89,6 @@ public class dPlayerMovement : NetworkBehaviour
|
|||
private bool qDown;
|
||||
private float tempCurVel;
|
||||
|
||||
//Blink
|
||||
private dBlink blink;
|
||||
|
||||
//Grapple
|
||||
private dGrapplingHook grapple;
|
||||
|
||||
|
|
@ -115,7 +112,6 @@ public class dPlayerMovement : NetworkBehaviour
|
|||
//Initialize Scripts
|
||||
pStats = GetComponent<PlayerStats>(); // PlayerStats
|
||||
wallRun = GetComponent<dWallRun>(); //Wallrun
|
||||
blink = GetComponent<dBlink>(); //Blink
|
||||
grapple = GetComponent<dGrapplingHook>();
|
||||
nitro = GetComponent<dNitro>();
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ using UnityEngine;
|
|||
|
||||
public class GrapplingHook : NetworkBehaviour
|
||||
{
|
||||
public float maxGrappleDistance = 15;
|
||||
public float maxGrappleDistance = 20;
|
||||
public float maxGrabDistance = 30;
|
||||
|
||||
public bool isGrappled;
|
||||
private int hookPointIndex;
|
||||
|
|
@ -73,8 +74,13 @@ public class GrapplingHook : 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;
|
||||
|
|
@ -114,9 +120,9 @@ public class GrapplingHook : 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());
|
||||
}
|
||||
|
|
@ -124,7 +130,7 @@ public class GrapplingHook : 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));
|
||||
|
||||
|
||||
|
|
@ -155,7 +161,9 @@ public class GrapplingHook : 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);
|
||||
}
|
||||
|
||||
|
|
@ -177,7 +185,7 @@ public class GrapplingHook : NetworkBehaviour
|
|||
//Finds the nearest hook to the player
|
||||
int FindHookPoint()
|
||||
{
|
||||
float least = maxGrappleDistance;
|
||||
float least = maxGrabDistance;
|
||||
int index = -1;
|
||||
for(int i = 0; i<hookPoints.Length; i++)
|
||||
{
|
||||
|
|
@ -304,7 +312,9 @@ public class GrapplingHook : NetworkBehaviour
|
|||
}
|
||||
|
||||
Vector3 CalculateSwingReleaseForce(){
|
||||
Vector3 releaseSwingForceDirection = momDirection * (swingMom + 20);
|
||||
|
||||
Vector3 releaseSwingForceDirection = momDirection * ((swingMom) + 10);
|
||||
|
||||
releaseSwingForceDirection = new Vector3(releaseSwingForceDirection.x,0,releaseSwingForceDirection.z);
|
||||
|
||||
if(swingMom < 5){
|
||||
|
|
|
|||
|
|
@ -89,9 +89,6 @@ public class PlayerMovement : NetworkBehaviour
|
|||
private bool qDown;
|
||||
private float tempCurVel;
|
||||
|
||||
//Blink
|
||||
private Blink blink;
|
||||
|
||||
//Grapple
|
||||
private GrapplingHook grapple;
|
||||
|
||||
|
|
@ -115,7 +112,6 @@ public class PlayerMovement : NetworkBehaviour
|
|||
//Initialize Scripts
|
||||
pStats = GetComponent<PlayerStats>(); // PlayerStats
|
||||
wallRun = GetComponent<WallRun>(); //Wallrun
|
||||
blink = GetComponent<Blink>(); //Blink
|
||||
grapple = GetComponent<GrapplingHook>();
|
||||
nitro = GetComponent<Nitro>();
|
||||
|
||||
|
|
@ -568,9 +564,10 @@ public class PlayerMovement : NetworkBehaviour
|
|||
//Slide Function
|
||||
private void Slide(){
|
||||
//if the q button or the east face button on gamepad is held down
|
||||
if (Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q)) {
|
||||
if ((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q))) {
|
||||
qDown = true;
|
||||
if (isSliding == false){
|
||||
|
||||
originalTraction = pStats.Traction;
|
||||
this.gameObject.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x - 90, this.transform.eulerAngles.y, this.transform.eulerAngles.z);
|
||||
isSliding = true;
|
||||
|
|
|
|||
|
|
@ -12,19 +12,19 @@ EditorUserSettings:
|
|||
value: 22424703114646680e0b0227036c6f1f05033f2b212d68252320092a
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-2:
|
||||
value: 22424703114646680e0b0227036c7b151b180b6501273035202c1327d1e33136e7a923e7ee2e26
|
||||
value: 22424703114646680e0b0227036c78111b125507233d28242c20137df7ee3d2cfb
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-3:
|
||||
value: 22424703114646680e0b0227036c731f1415016439262f2434
|
||||
value: 22424703114646680e0b0227036c6b19021b1d192f2d2835633c133af6f9
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-4:
|
||||
value: 22424703114646680e0b0227036c78111b125507233d28242c20137df7ee3d2cfb
|
||||
value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-5:
|
||||
value: 22424703114646680e0b0227036c78111b125507233d28242c20137df7ee3d2cfb
|
||||
value: 22424703114646680e0b0227036c7b151b180b6501273035202c1327d1e33136e7a923e7ee2e26
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-6:
|
||||
value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb
|
||||
value: 22424703114646680e0b0227036c7b151b180b6501273035202c1327d1e33136e7a923e7ee2e26
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-7:
|
||||
value: 22424703114646680e0b0227036c7b151b180b652b3a27292f260573f1e33136e7a923e7ee2e26
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user