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

How can I RESTART an LEGACy animation to frame 0

Discussion in 'Scripting' started by Unlimited_Energy, Aug 26, 2016.

  1. Unlimited_Energy

    Unlimited_Energy

    Joined:
    Jul 10, 2014
    Posts:
    469
    I have tried EVERy method on the internet adn documentation and NOTHING is able to restart a legacy animation back to its original state.... Any idea how I can restart the animation so after it is done playing I can call a coroutine to reset it to frame 0 after 4 seconds....
     
  2. Unlimited_Energy

    Unlimited_Energy

    Joined:
    Jul 10, 2014
    Posts:
    469
    wow no solution? Unity needs to get on this man. Super frustrating its not a simple to reset back to frame 0....
     
  3. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
  4. Unlimited_Energy

    Unlimited_Energy

    Joined:
    Jul 10, 2014
    Posts:
    469
    I will see if this works. thanks man.
     
  5. stimul

    stimul

    Joined:
    Nov 28, 2013
    Posts:
    11
    its not work
     
  6. HyagoOliveira

    HyagoOliveira

    Joined:
    May 17, 2021
    Posts:
    6
    You can reset to the first frame by executing:

    Code (CSharp):
    1. animation.Rewind();
    2. animation.Play();
    3. animation.Sample();
    4. animation.Stop();
     
    FunSTW and MorganYT like this.