Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by DoctorSauce · Nov 28, 2013 at 03:51 PM · animationwrapmode

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.

alt text

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?

no wrap mode option.png (74.6 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fattie · Apr 11, 2014 at 07:36 AM 0
Share

From 2014, with the "traditional" Animation window,

in your Inspector of the object in question (not the animation, the object

You must select the DEBUG option from the tiny menu at the extreme top right of the Inspector panel

.

then you will clearly see "Wrap $$anonymous$$ode" on the animation component in Inspector.

Silly eh!

5 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by el-santia93 · Nov 28, 2013 at 04:27 PM

you could do it with script real easy

 gameObject.animation["animationName"].wrapMode=WrapMode.PingPong;
Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DoctorSauce · Nov 28, 2013 at 04:43 PM 0
Share

Thanks for the response, but I probably should have specified. I tried this already, and the problem was there is no animation attached to the object, only an animator. If I add the animation to the object, the script just gives me a NullReferenceException and continues to act the same way it did, without the Ping Pong wrap. If I don't add the animation, it just tells me it can't find an animation object, because I only have an animator. I really think it should not be this complicated, I think it has to do with the 4.3 update.

Any ideas on how I could fix that problem? Thanks again.

avatar image el-santia93 · Nov 28, 2013 at 04:51 PM 0
Share

I don't know about 4.3 but on 4.1 when i had this problem here's what i did click on the the model itself(.blend,.fbx,etc) then in the importer settings click rig. select legacy under this option and apply.now click animation u can now change the wrap mode of your animation. under the model tab you will see that your model now has an Animation component. Hope this helps

avatar image DoctorSauce · Nov 28, 2013 at 05:02 PM 0
Share

Well, I am fairly certain you just solved my problem because I remember seeing something in the console about Legacy, but I wasn't sure what it meant. Doing this will mean I have to change a lot of things, but I'm going to mark your answer as correct because I am pretty much positive that it will work. Thank you very much!

avatar image
1

Answer by apple92 · Nov 28, 2013 at 04:29 PM

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by gordeszkakerek · Apr 21, 2014 at 03:08 PM

Here's my tutorial video: https://www.youtube.com/watch?v=3gp4rGO8vAA

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image demented_hedgehog · Jul 11, 2015 at 02:34 AM 0
Share

The video is unavailable .. in australia at least.

avatar image
0

Answer by demented_hedgehog · Jul 11, 2015 at 02:39 AM

Things have changed since 4.3 (there's a difference between the legacy and new systems)...
http://answers.unity3d.com/questions/580365/wrapmode-option-not-available-in-unity-43.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by rooster · Jun 18, 2019 at 04:27 PM

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
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can I make animations snap to a frame? 1 Answer

Animation wrapmode in mechanim? (hip rotate and stay) 0 Answers

Single Time Animation Play 1 Answer

Programmatically created AnimationClip will not loop 2 Answers

Animation Wrapmode - once the value is set in code, can it be changed behind the scenes? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges