mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-22 02:14:30 -05:00
Gate created and player tagged correctly
This commit is contained in:
@@ -28,8 +28,6 @@ public class dKickController : NetworkBehaviour
|
||||
}
|
||||
|
||||
void Kick(){
|
||||
//Note: when we merge this into PlayerMovement, we may want to change isgrounded to our
|
||||
//custom is grounded
|
||||
if (Input.GetKeyDown(KeyCode.F) && isKicking == false && characterController.isGrounded == false)
|
||||
{
|
||||
Debug.Log("dive");
|
||||
@@ -67,6 +65,9 @@ public class dKickController : NetworkBehaviour
|
||||
//if (!IsLocalPlayer) { return; }
|
||||
Collider myCollider = collision.contacts[0].thisCollider;
|
||||
if (collision.transform.CompareTag("kickable") && myCollider == leg.GetComponent<Collider>()){
|
||||
if(collision.gameObject.GetComponent<Rigidbody>().isKinematic == true){
|
||||
collision.gameObject.GetComponent<Rigidbody>().isKinematic = false;
|
||||
}
|
||||
Vector3 direction = this.transform.forward;
|
||||
Debug.Log(direction);
|
||||
collision.rigidbody.AddForce(direction * pStats.KickPow, ForceMode.Impulse);
|
||||
|
||||
@@ -7,7 +7,7 @@ using UnityEngine.Rendering;
|
||||
public class dWallRun : NetworkBehaviour
|
||||
{
|
||||
|
||||
public float wallMaxDistance = 5;
|
||||
public float wallMaxDistance = .8f;
|
||||
public float wallSpeedMultiplier = 1.2f;
|
||||
public float minimumHeight = .1f;
|
||||
public float maxAngleRoll = 20;
|
||||
@@ -32,7 +32,6 @@ public class dWallRun : NetworkBehaviour
|
||||
float elapsedTimeSinceJump = 0;
|
||||
float elapsedTimeSinceWallAttach = 0;
|
||||
float elapsedTimeSinceWallDetatch = 0;
|
||||
bool attachOnce = false;
|
||||
bool jumping;
|
||||
|
||||
bool isPlayergrounded() => playerMovementController.isGrounded;
|
||||
@@ -177,9 +176,8 @@ public class dWallRun : NetworkBehaviour
|
||||
|
||||
playerMovementController.SetPlayerVelocity(moveToSet);
|
||||
isWallRunning = true;
|
||||
if(!attachOnce && playerMovementController.curJumpNum != 0){
|
||||
playerMovementController.curJumpNum = playerMovementController.curJumpNum - 2 ;
|
||||
attachOnce = true;
|
||||
if(playerMovementController.curJumpNum != 0){
|
||||
playerMovementController.curJumpNum = 0 ;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -199,10 +197,6 @@ public class dWallRun : NetworkBehaviour
|
||||
|
||||
public Vector3 GetWallJumpDirection() //Add call in jump where if we are wallrunning and jump, the jump vector is multiplied by this
|
||||
{
|
||||
if(isWallRunning)
|
||||
{
|
||||
return lastWallNormal * wallBouncing + Vector3.up;
|
||||
}
|
||||
return Vector3.zero;
|
||||
}
|
||||
return lastWallNormal * wallBouncing + (transform.up);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user