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
0
Question by harko12 · Sep 03, 2012 at 12:52 PM · animationwrapmode

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

I have an animation controller class that I made, for a character that runs around and jumps. All of that works fine. I decided to add a sword slash. I put in the animation, then put in this code in the start function of the animation controller script.

     var oneHandSwordAnim = animation["up_sword_action"];
     oneHandSwordAnim.wrapMode = WrapMode.Once;
     oneHandSwordAnim.layer = 3;

I would think that would set the wrapmode for the animation for any further time I felt like using it. But in the update when I play that animation, it loops anyway. I looked in the debugger and the wrapmode was set back to loop. Is there anything that can change the wrapmode on animations like that out from under you? I use a similar technique in the jump animation and it works fine.

Thanks!

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 harko12 · Sep 04, 2012 at 02:20 AM 0
Share

It's possible. I checked all the other ones, and their wrapmodes seemed right. I did have an line of code setting the default to be loop early on in the controller, I'll try taking that out and see if it helps.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Andre-Odendaal · Dec 31, 2012 at 09:16 PM

I found the same problem and the solution I've used is to do it the other way around. On the model set the Animation Wrap Mode to Once which will apply to all animations and then set the animations that need looping in script (i.e. walking, idling, etc).

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 harko12 · Jan 01, 2013 at 12:58 AM 0
Share

That does seem like a good idea. It's all moot now that I'm using $$anonymous$$echanim ins$$anonymous$$d though.

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

8 People are following this question.

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

Related Questions

Wrap Mode in animator not working properly 0 Answers

Once Animation Wrapmode v4.3.3 0 Answers

Animation Wrap Mode Usage? 1 Answer

Clamping an animation does not work. Help! 0 Answers

Animation scripting problem! 0 Answers


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