Search Unity

MY DIE CHARACTER ANIMATION GOT "SOMETHING" POSSESED IT !!!

Discussion in 'Animation' started by gardevoirea, May 13, 2017.

  1. gardevoirea

    gardevoirea

    Joined:
    May 12, 2017
    Posts:
    11
    i`m new at unity so let me start from start problem :
    i wanna create a character die animation ,
    here the code to trigger death animation (condition 4)

    Public void GetHit(float damage){
    if (dead)
    return;
    anim.SetInteger ("Condition", 3);
    currentHealth -= damage;

    if (currentHealth <= 0){
    Die ();
    return;
    }
    StartCoroutine (RecoverFromHit ());
    }

    void Die(){
    anim.SetInteger("Condition",4);
    dead = true;
    DropLoot ();
    foreach (GameObject go in players)
    if(go == this.gameObject) {
    go.GetComponent<ShirorenzsPuppet>().SetExperience(expGranted/players.Length);
    }
    GameObject.Destroy(this.gameObject,5);
    }

    and also here`s my animator
    upload_2017-5-13_10-27-37.png

    then when i hit them with my last hit , they just don`t want die !!!
    they keep idling like a zombie until the destroy game object works and vanish them :`)

    upload_2017-5-13_10-29-45.png

    But here the scary part , sometime THEY REALLY DIE !!!

    upload_2017-5-13_10-33-28.png

    ARE THEY POSSESED BY SOMETHING :`) ?

    upload_2017-5-13_10-38-32.png
     
unityunity