mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 09:54:28 -05:00
small changes to player and items for cleanup
This commit is contained in:
@@ -9,7 +9,7 @@ public class dBlink : NetworkBehaviour{
|
||||
|
||||
// Start is called before the first frame update
|
||||
|
||||
private Camera cam;
|
||||
public Camera cam;
|
||||
public CharacterController controller;
|
||||
//Blink Variables
|
||||
private LineRenderer beam;
|
||||
@@ -36,12 +36,11 @@ public class dBlink : NetworkBehaviour{
|
||||
|
||||
// Grab the main camera.
|
||||
//camera transform
|
||||
cam = GetComponentInChildren<Camera>();
|
||||
}
|
||||
|
||||
//ADJUST SO DISTANCE IS DETERMINED BY SCROLL WHEEL
|
||||
//blinks the player forwards
|
||||
private void BlinkMove()
|
||||
public void BlinkMove()
|
||||
{
|
||||
//if (!IsLocalPlayer) { return; }
|
||||
|
||||
|
||||
@@ -22,21 +22,22 @@ public class dDash : NetworkBehaviour{
|
||||
//UPDATE CHECK FOR MOVEMENT ONLY WHEN DASHING
|
||||
void FixedUpdate(){
|
||||
//if (!IsLocalPlayer) { return; }
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.E))
|
||||
{
|
||||
currentDashTime = 0;
|
||||
if(characterController.enabled == true){
|
||||
if (Input.GetKeyDown(KeyCode.E))
|
||||
{
|
||||
currentDashTime = 0;
|
||||
}
|
||||
if(currentDashTime < maxDashTime)
|
||||
{
|
||||
moveDirection = transform.forward * dashDistance;
|
||||
currentDashTime += dashStoppingSpeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
moveDirection = Vector3.zero;
|
||||
}
|
||||
characterController.Move(moveDirection * Time.deltaTime * dashSpeed);
|
||||
}
|
||||
if(currentDashTime < maxDashTime)
|
||||
{
|
||||
moveDirection = transform.forward * dashDistance;
|
||||
currentDashTime += dashStoppingSpeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
moveDirection = Vector3.zero;
|
||||
}
|
||||
characterController.Move(moveDirection * Time.deltaTime * dashSpeed);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -41,7 +41,6 @@ public class dWallRun : NetworkBehaviour
|
||||
bool CanWallRun()
|
||||
{
|
||||
float verticalAxis = Input.GetAxisRaw("Vertical");
|
||||
|
||||
return !isPlayergrounded() && verticalAxis > 0 && VerticalCheck();
|
||||
}
|
||||
|
||||
@@ -155,6 +154,7 @@ public class dWallRun : NetworkBehaviour
|
||||
playerMovementController.SetPlayerVelocity(moveToSet);
|
||||
//Debug.Log("On Wall");
|
||||
isWallRunning = true;
|
||||
Debug.Log("Is Wallrunning");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,8 @@ public class dPlayerMovement : NetworkBehaviour
|
||||
private Vector3 up;
|
||||
private bool qDown;
|
||||
|
||||
//Kick Variables
|
||||
//Blink
|
||||
private dBlink blink;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
@@ -93,6 +94,8 @@ public class dPlayerMovement : NetworkBehaviour
|
||||
//Wallrun
|
||||
wallRun = gameObject.GetComponent<dWallRun>();
|
||||
|
||||
blink = gameObject.GetComponent<dBlink>();
|
||||
|
||||
up = this.gameObject.GetComponentInParent<Transform>().up;
|
||||
}
|
||||
|
||||
@@ -155,12 +158,16 @@ public class dPlayerMovement : NetworkBehaviour
|
||||
|
||||
//TEMP FOR TESTING RAGDOLL
|
||||
//Right Click to ragdoll the player
|
||||
if (Input.GetMouseButton(1) && heldDown == false){
|
||||
getHit(new Vector3(vel.x, 0, vel.z), 30);
|
||||
heldDown = true;
|
||||
}
|
||||
if(!Input.GetMouseButton(1)){
|
||||
heldDown = false;
|
||||
// if (Input.GetMouseButton(1) && heldDown == false){
|
||||
// getHit(new Vector3(vel.x, 0, vel.z), 30);
|
||||
// heldDown = true;
|
||||
// }
|
||||
// if(!Input.GetMouseButton(1)){
|
||||
// heldDown = false;
|
||||
// }
|
||||
|
||||
if(pStats.HasBlink == true){
|
||||
blink.BlinkMove();
|
||||
}
|
||||
|
||||
//TEMP FOR TESTING
|
||||
|
||||
Reference in New Issue
Block a user