Merge branch 'controller' into main

This commit is contained in:
Evan Nydahl
2021-12-03 13:42:41 -06:00
18 changed files with 523 additions and 421 deletions

View File

@@ -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);