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

Question Pendulum Loop Animation

Discussion in 'Animation' started by Hend_d, Jan 28, 2022.

  1. Hend_d

    Hend_d

    Joined:
    Feb 28, 2017
    Posts:
    5
    Hi there, I want to make a loop with the Animator which is playing the animation I've set up from start to end and then reverse from end to start and this inside a loop.

    For better understanding something like this:
    sprite1->sprite2->sprite3->sprite4->sprite3->sprite2->sprite1....and repeat

    Sure I could place the sprites like this in the animation and loop it, but this would mean a big manual work instead of a probably simple code snippet?
    I've also tried to change the speed (set it to -1 to reverse) of the animator when the last frame is played, but this doesn't work very well.

    If you have any idea how to efficient solve my dilema let me know and thanks in advance.
     
  2. Unrighteouss

    Unrighteouss

    Joined:
    Apr 24, 2018
    Posts:
    599
    Hello,

    I think it's actually much less work to animate the reverse motion instead of using code. If you check "loop" in the animation's inspector it will loop the animation for you, so you only need to animate one cycle of the pendulum.
     
    Hend_d likes this.
  3. Hend_d

    Hend_d

    Joined:
    Feb 28, 2017
    Posts:
    5
    Thx for your answer Unrighteouss,
    much less work i wouldn't say but the only working solution for now, just try to imagine the effort for manually sorting like 100 animation.

    Strange that this option wasn't implemented. Especially for VN's this is a must have... Why would somebody render extra images or copy and sort them manually if you could do it in the Animator with a simple click.

    If I find a more efficient way or alternative I might update this thread, let's see.