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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Animation playing once, then playing the first few frames when it shouldn't

Discussion in 'Animation' started by Abbrew, Jul 4, 2018.

  1. Abbrew

    Abbrew

    Joined:
    Jan 1, 2018
    Posts:
    417
    I'm dealing with an issue with animation transitions in Unity. Whenever there is an animation transition, the animation would replay its first few frames before transitioning.

    Here is my animator

    And here are the animation properties
     
  2. Goatogrammetry

    Goatogrammetry

    Joined:
    Apr 27, 2017
    Posts:
    196
    Looks like you may have accidentally stretched StandAttack's bar on the right side. I see a line there at the edge. Slide it around a little. I'm not a fan of the analog style of the blending controls. I'd like to be able to type in numbers. Ah well.
     
  3. Abbrew

    Abbrew

    Joined:
    Jan 1, 2018
    Posts:
    417
    Thanks. I tried your suggestion and tuned the animation. That didn't solve the problem, unfortunately. However, I turned off loop time and it no longer played the 1st frame. Still, I want to be able to loop the animation without encountering that nasty side effect. Do you have any insight into this?
     
  4. Abbrew

    Abbrew

    Joined:
    Jan 1, 2018
    Posts:
    417
    I just discovered that the transition replays the first few frames of the original animation before playing the animation it's transitioning to, not just the first frame.
     
  5. Goatogrammetry

    Goatogrammetry

    Joined:
    Apr 27, 2017
    Posts:
    196
    What? Weird... I have never had a problem. How many FPS was the original animation done at? I used to like to use 12 FPS but unity reports everything at 30. Things played ok but I wonder if there's a quirk when you make animations at arbitrary FPS. Just an idea.
     
  6. Abbrew

    Abbrew

    Joined:
    Jan 1, 2018
    Posts:
    417
    I ended up "solving" the problem by using the appropriate animation settings depending on the transition. Turns out that for animation states with an exit time checked transition, an animation with loop time unchecked is appropriate. When the animation is meant to loop until a transition, THEN the loop time should be checked. I was doing the opposite. Thank you for following this thread and providing suggestions :)