mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-22 18:34:32 -05:00
Merge branch 'controller' into main
This commit is contained in:
@@ -28,7 +28,10 @@ public class dKickController : NetworkBehaviour
|
||||
}
|
||||
|
||||
void Kick(){
|
||||
if (Input.GetKeyDown(KeyCode.F) && isKicking == false && characterController.isGrounded == false)
|
||||
//Note: when we merge this into PlayerMovement, we may want to change isgrounded to our
|
||||
//custom is grounded
|
||||
//If F is pressed or gamepad right trigger is pulled
|
||||
if ((Input.GetKeyDown(KeyCode.F) || Input.GetAxis("Kick") != 0) && isKicking == false && characterController.isGrounded == false)
|
||||
{
|
||||
Debug.Log("dive");
|
||||
// if kicking in air, kick until grounded (maybe add some foward momentum if needeD)
|
||||
@@ -37,13 +40,14 @@ public class dKickController : NetworkBehaviour
|
||||
leg.SetActive(true);
|
||||
}
|
||||
//otherwise do ground kick for .3 seconds
|
||||
else if (Input.GetKeyDown(KeyCode.F) && isKicking == false){
|
||||
else if ((Input.GetKeyDown(KeyCode.F) || Input.GetAxis("Kick") != 0) && isKicking == false){
|
||||
Debug.Log("kick");
|
||||
StartCoroutine(Kicking(.3f));
|
||||
}
|
||||
|
||||
//once dive kick touches ground, set back to normal state
|
||||
if(characterController.isGrounded == true && isDiveKicking == true){
|
||||
if (characterController.isGrounded == true && isDiveKicking == true)
|
||||
{
|
||||
isDiveKicking = false;
|
||||
isKicking = false;
|
||||
leg.SetActive(false);
|
||||
|
||||
Reference in New Issue
Block a user