mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-04-26 02:00:54 -05:00
Updated player prefabs and non debug scripts
I did remember to uncomment if(!isLocalPlayer) thing
This commit is contained in:
parent
574b1d9431
commit
df02d905b3
|
|
@ -3543,8 +3543,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
|
||||
|
|
@ -3724,6 +3724,7 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
maxGrappleDistance: 25
|
||||
maxGrabDistance: 30
|
||||
isGrappled: 0
|
||||
ropeLength: 0
|
||||
forceDirection: {x: 0, y: 0, z: 0}
|
||||
|
|
|
|||
|
|
@ -205,15 +205,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
|
||||
|
|
@ -386,6 +386,7 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
maxGrappleDistance: 25
|
||||
maxGrabDistance: 30
|
||||
isGrappled: 0
|
||||
ropeLength: 0
|
||||
forceDirection: {x: 0, y: 0, z: 0}
|
||||
|
|
|
|||
|
|
@ -259,8 +259,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
|
||||
|
|
@ -426,6 +426,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}
|
||||
|
|
@ -299,8 +299,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
|
||||
|
|
@ -347,7 +347,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
|
||||
|
|
@ -355,7 +355,7 @@ MonoBehaviour:
|
|||
cam: {fileID: 7188906082643956516}
|
||||
minAngle: -30
|
||||
maxAngle: 30
|
||||
sensitivity: 301
|
||||
sensitivity: 200
|
||||
isSliding: 0
|
||||
--- !u!114 &273103334658887749
|
||||
MonoBehaviour:
|
||||
|
|
@ -405,7 +405,7 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
moveDirection: {x: 0, y: 0, z: 0}
|
||||
dashDistance: 10
|
||||
dashDistance: 15
|
||||
dashStoppingSpeed: 0.1
|
||||
dashItem: {fileID: 11400000, guid: 4399d7276b3edf446ac51c5145539a5e, type: 2}
|
||||
--- !u!114 &3672942772524564832
|
||||
|
|
@ -421,6 +421,7 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
maxGrappleDistance: 25
|
||||
maxGrabDistance: 30
|
||||
isGrappled: 0
|
||||
ropeLength: 0
|
||||
forceDirection: {x: 0, y: 0, z: 0}
|
||||
|
|
|
|||
|
|
@ -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,14 @@ 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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user