mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-22 18:34:32 -05:00
Gate created and player tagged correctly
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user