Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Don't know why the animation works

Discussion in 'Animation' started by nguyentruongduan2002, Aug 12, 2023.

  1. nguyentruongduan2002

    nguyentruongduan2002

    Joined:
    Dec 24, 2022
    Posts:
    1
    I got an error that I can't explain how, when I press 1, the character attacks, but when I start the game, the character attacks continuously even though the condition is not met. Screenshot (7).png Screenshot (8).png Screenshot (9).png Screenshot (10).png
     
  2. tsukimi

    tsukimi

    Joined:
    Dec 10, 2014
    Posts:
    50
    Every int is default initialized to 0, and the transition condition is "stateAttack == 0", so it should be always playing the attack state. Try using other integer than 0 to represent Attack state.