mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 18:04:27 -05:00
Bumper has been fixed sort of
You need to use 2 colliders one thats a trigger and one thats not and it will work properly
This commit is contained in:
@@ -16,13 +16,19 @@ public class dDash : NetworkBehaviour{
|
||||
float dashSpeed = 12;
|
||||
|
||||
CharacterController characterController;
|
||||
dPlayerMovement pMove;
|
||||
|
||||
void Start(){
|
||||
characterController = this.gameObject.GetComponent<CharacterController>();
|
||||
pMove = GetComponent<dPlayerMovement>();
|
||||
}
|
||||
|
||||
//UPDATE CHECK FOR MOVEMENT ONLY WHEN DASHING
|
||||
void FixedUpdate(){
|
||||
if(pMove.pStats.HasDash) Dash();
|
||||
}
|
||||
|
||||
void Dash(){
|
||||
//if (!IsLocalPlayer) { return; }
|
||||
if(characterController.enabled == true){
|
||||
if (Input.GetKeyDown(KeyCode.E) && isOnCoolDown == false)
|
||||
|
||||
@@ -84,9 +84,9 @@ public class dGrapplingHook : NetworkBehaviour
|
||||
if (Vector3.Distance(gameObject.transform.position, hookPoint.transform.position) > ropeLength)
|
||||
{
|
||||
//Impact Based
|
||||
playerMovement.AddImpact((hookPoint.transform.position - gameObject.transform.position), pStats.PlayerGrav);
|
||||
//playerMovement.AddImpact((hookPoint.transform.position - gameObject.transform.position), pStats.PlayerGrav*2);
|
||||
//Character controller move?
|
||||
//movementController.Move((hookPoint.transform.position - gameObject.transform.position).normalized * ropeLength*Time.deltaTime);
|
||||
movementController.Move((hookPoint.transform.position - gameObject.transform.position).normalized * ropeLength * 10 *Time.deltaTime);
|
||||
//Lerp? or another smoother way? Better physics? Wait until refinement to deal with
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class dPlayerMovement : NetworkBehaviour
|
||||
//Jump value
|
||||
public int curJumpNum; // current Jumps used
|
||||
private bool jumpHeld; // Is jump being held
|
||||
float coyJumpTimer = 0.2f; // Default Coyote Jump time
|
||||
float coyJumpTimer = 0.1f; // Default Coyote Jump time
|
||||
float curCoyJumpTimer; // current Coyote Jump time
|
||||
public float lowJumpMultiplier; // Short jump multiplier
|
||||
public float fallMultiplier; // High Jump Multiplier
|
||||
@@ -147,23 +147,18 @@ public class dPlayerMovement : NetworkBehaviour
|
||||
impact = Vector3.Lerp(impact, Vector3.zero, 5*Time.deltaTime);
|
||||
}
|
||||
|
||||
//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 Character controller is disabled use rigidbody calculations
|
||||
else{
|
||||
//if ragdoll timer is over disable ragdolling
|
||||
if (RagdollTimer() == 0){
|
||||
firstHit = false;
|
||||
DisableRagdoll();
|
||||
}
|
||||
|
||||
if(pStats.HasBlink == true){
|
||||
blink.BlinkMove();
|
||||
//Gravity without moveController
|
||||
g -= pStats.PlayerGrav * Time.deltaTime;
|
||||
rB.AddForce(new Vector3(0,g,0));
|
||||
}
|
||||
|
||||
//TEMP FOR TESTING
|
||||
//Checks if player should respawn
|
||||
//Respawn();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user