How do I change the wrap mode on an animation?

This is probably the stupidest question ever asked on this forum, but I can NOT figure out how to change the wrap mode for an animation I made. I just want an object to rotate from 0 to 180 degrees (which that part works fine), and then back again, using the Ping Pong wrap mode. Except, I can’t find the option to change the wrap mode to Ping Pong.

[18666-no+wrap+mode+option.png|18666]

Shouldn’t the option to change the wrap mode be where the red circle is? And if not, how do I change it? I feel like an idiot asking this but thank you for any help in advance.

Edit:

I should also add that I am using the latest version of Unity, 4.3. Maybe the interface changed or something. But I still can not figure it out… am I just missing something obvious?

You can change the Wrapmode in your Inspector Tab. Navigate to the Animation file and select it. If Wrapmode is greyed out, select the Asset which contains those animations and then click on the Animations tab in the Inspector (There are Model/Rig/Animation tab for imported Objects).

It can also be changed via Script on runtime: http://docs.unity3d.com/Documentation/ScriptReference/WrapMode.html

you could do it with script real easy

gameObject.animation["animationName"].wrapMode=WrapMode.PingPong;

Here’s my tutorial video: - YouTube

Things have changed since 4.3 (there’s a difference between the legacy and new systems)…

I’ve been doing this the hard way for years and just figured out a simple clean way to do it that builds on the answers here. I’m using Unity 2019 but I suspect it would work in earlier versions.

  1. Create an animation clip as usual
  2. Select the clip in the project and turn off the Loop Time flag
  3. Add the animation clip to Animator twice. Name the two states “in” and “out” or whatever works.
  4. Set the speed on the “out” clip state to -1
  5. Play the states normally in code

E.g.

Animator anim = GetComponent<Animator>();
anim.Play("in");       // to play the forward animation. It will hold on the last frame of clip
anim.Play("out");    // to play the backward animation. It will hold on the first frame of clip