Falling sound verzögert

This commit is contained in:
DominikB
2023-06-24 15:03:08 +02:00
parent ba6e8cd54e
commit d8bbb48ccb
2 changed files with 202 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ public class FallingDetection : MonoBehaviour
public AudioClip landeSound; // The sound clip to be played
public AudioClip sprungSound; // The sound clip to be played
public bool isJumping = false;
private int counterFall = 0;
private void Start()
@@ -40,11 +41,13 @@ public class FallingDetection : MonoBehaviour
isFalling = true;
animator.SetBool("IsFalling", true);
counter = 0;
wasFallingbefore = true;
if(counterFall++>180){
wasFallingbefore = true;}
}
} else {
isFalling = false;
counter = 0;
counterFall=0;
animator.SetBool("IsFalling", false);
if(wasFallingbefore){
wasFallingbefore = false;