- Home /
How do I set a 2D sprite animation to ping-pong wrap mode? Debug mode setting does not work
I have a falling animation that I need to wrap in pingpong mode in 2D unity 5. I've opened the animation file in the inspector and set the wrap mode to pingpong, but the animation still just loops regularly in the default way.
I read on another answer that it needs to be a Legacy animation type, so I check the box for Legacy, and now the Animation State in my controller doesn't accept the falling animation anymore.
I tried setting it in script, but the ability to modify specific animations in script has been deprecated for some reason. Please bear in mind that this is just one animation in one state in one animator controller that I need in pingpong mode.
I've looked around everywhere online for an answer and I've come up with none. Help a brother out? How do I set a 2D sprite animation to pingpong wrap mode?
Answer by Adam-Halley-Prinable · Jan 05, 2016 at 03:09 AM
Looks like as of Unity Version 5.3.0f4 there is no unity native way to do this, and wrapmode editing is no longer possible. To get my desired effect, I just manually edited the animation. I copied the frames and reversed them, making the native wrapmode look like a pingpong. Close enough I guess.
Answer by CodeFighter · Aug 27, 2018 at 08:51 AM
Unfortunately, legacy pingpong doesn't work with Animator. Presumably, you should create loop animation directly in Animator For pingpong: First animation with normal speed =1 and the second with speed = -1
Thanks @CodeFighter, simple technique and very useful for pingpong animation through animator window.
Answer by yamamotojr · Dec 29, 2016 at 06:08 AM
Found this answer online looking at the same problem. Hope it helps.
http://answers.unity3d.com/questions/1011347/where-is-the-options-for-set-wrap-mode-of-animatio.html
Your answer
Follow this Question
Related Questions
Wrap Mode PingPong not working 2 Answers
2D Animation does not start 1 Answer
2D sprites animation is not working - using tiled texture extended. 0 Answers
How can I handle dynamic 2D animations? 0 Answers