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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

How to make an loop animation?

Discussion in 'General Discussion' started by david873025517, May 30, 2020.

  1. david873025517

    david873025517

    Joined:
    May 27, 2020
    Posts:
    10
    I'm using 2018 version, I checked the loop time and switch the warp mode to looping, however when I put it in the game it does not looping at all, just play once and done with it. I search for solution for whole day and all I find are whether outdated answer or people who trying to stop their animation from looping.
     
  2. DimitriX89

    DimitriX89

    Joined:
    Jun 3, 2015
    Posts:
    550
    If it "plays once and done", more likely its something with your State machine or code you use to run it than with animation itself
     
  3. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    @david873025517 I assume you are trying to use Mecanim, so see the manual for the basics:
    https://docs.unity3d.com/Manual/AnimationOverview.html

    You should make a state for your animation, one of those blocks you see in the manual images. Then make a transition to it, and also from it to your default state (for example) and then set a rule when to enter and exit (see the Conditions area in Inspector when you select that transition line.) You could use a boolean which you add to the Parameter area in your Animator window.
     
  4. david873025517

    david873025517

    Joined:
    May 27, 2020
    Posts:
    10
    Thanks for replying, I guess it was because the script.