Search Unity

run-pain-run

Discussion in 'Animation' started by alterus, Aug 22, 2016.

  1. alterus

    alterus

    Joined:
    Sep 9, 2012
    Posts:
    59
    Hello



    My player hits with a sword an enemy in fast motion

    The enemy must stop for a while, play a "pain" animation and then he must start running again

    I used the OnTriggerEntry() and OnTriggerExit() function but what I could get is :

    a) The enemy play a run-pain-run-pain...cycle for ever
    or
    b) The enemy play one only cycle : run-pain-run that's ok but most of the times he keep running whithout playing the "pain" anim even though I am sure that the sword entered its collider

    What shall I do ?

    Thanks in advance for support