Search Unity

Question stopping an animation then triggers to play it.

Discussion in 'Animation' started by drewbug5663, Jan 5, 2024.

  1. drewbug5663

    drewbug5663

    Joined:
    Sep 25, 2021
    Posts:
    28
    I had this working but some how broke it, I can not figure it out now.

    I have a animator controller all set up on a game object. I want it to play only when hit.

    idle to start and stop here do not go to open. I made the trigger "destroy"

    upload_2024-1-5_18-41-44.png


    code to issue trigger is


    anim.SetTrigger("destroy");
    audioData.Play();




    but for some reason the animation just starts. It does not wait for the trigger
     
  2. drewbug5663

    drewbug5663

    Joined:
    Sep 25, 2021
    Posts:
    28
    I guess the dot on the trigger is the default state. I had it set to on.