Gate created and player tagged correctly

This commit is contained in:
Melbyj1125
2021-12-03 13:17:12 -06:00
parent 55885e2ef1
commit 17d804080d
59 changed files with 419 additions and 76 deletions

View File

@@ -26,7 +26,7 @@ public class PlayerMovement : NetworkBehaviour
private CharacterController moveController;
//Jump value
private int curJumpNum;
public int curJumpNum;
private bool jumpPressed;
bool tempSet = false;
float tempTraction = 0.0f;
@@ -65,7 +65,7 @@ public class PlayerMovement : NetworkBehaviour
private Rigidbody rB;
private CapsuleCollider capCol;
private bool firstHit = false;
private bool heldDown = false;
//private bool heldDown = false; //Variable for testing ragdoll reenable if needed
private bool beginRagTimer = false;
private float ragTime;
private Vector3 prevRot;
@@ -239,7 +239,13 @@ public class PlayerMovement : NetworkBehaviour
//If space is pressed apply an upwards force to the player
if (Input.GetAxis("Jump") != 0 && !jumpPressed && curJumpNum + 1 < pStats.JumpNum && !isSliding)
{
AddImpact(transform.up, pStats.JumpPow);
if(wallRun.IsWallRunning()){
AddImpact((wallRun.GetWallJumpDirection()), pStats.JumpPow * 1.3f);
AddImpact(transform.up, pStats.JumpPow);
}
else{
AddImpact(transform.up, pStats.JumpPow);
}
curJumpNum++;
jumpPressed = true;
}
@@ -328,7 +334,7 @@ public class PlayerMovement : NetworkBehaviour
tempSet = true;
}
}
else{
else if(!jumpPressed && pStats.HasGlider){
if(tempSet == true){
pStats.Traction = tempTraction;
@@ -340,9 +346,11 @@ public class PlayerMovement : NetworkBehaviour
}
//Wallrunning
if (pStats.HasWallrun) { wallRun.WallRunRoutine(); } //adjusted later if we are wallrunning
//If gliding
//Go down slowly
else if (pStats.HasWallrun) { wallRun.WallRunRoutine(); } //adjusted later if we are wallrunning
else{
vel.y -= pStats.PlayerGrav * Time.deltaTime;
}
}