Made some small improvements to wallrun and the player prefabs

Grapple movement is a lot better just need to implement momentum
This commit is contained in:
Melbyj1125
2022-01-09 08:12:14 -06:00
parent 107e40e168
commit c881e37b9c
7 changed files with 151 additions and 102 deletions

View File

@@ -33,7 +33,10 @@ public class dPlayerMovement : NetworkBehaviour
float curCoyJumpTimer; // current Coyote Jump time
public float lowJumpMultiplier; // Short jump multiplier
public float fallMultiplier; // High Jump Multiplier
public float g = 0; // the y velocity
//Gravity values
public float g = 0; // the y velocity affected by player Grav
private float maxG = -100; //The max downwards y velocity or g the player can have
//Glide Values
bool tempSet = false;
@@ -89,6 +92,7 @@ public class dPlayerMovement : NetworkBehaviour
//Blink
private dBlink blink;
//Grapple
private dGrapplingHook grapple;
@@ -190,6 +194,7 @@ public class dPlayerMovement : NetworkBehaviour
vel = moveX + moveZ;
Vector3 moveXZ = new Vector3(vel.x, 0, vel.z);
driftVel = Vector3.Lerp(driftVel, moveXZ, pStats.Traction * Time.deltaTime);
if(grapple.isGrappled) driftVel = Vector3.zero;
//Gravity and Jump calculations
UpdateGravity();
@@ -458,6 +463,11 @@ public class dPlayerMovement : NetworkBehaviour
else{
g = 0;
}
//Caps out the players downwards speed
if(g < maxG){
g = maxG;
}
}