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 Kissanaattori · May 13, 2015 at 05:45 PM · c#animationik

Modifying animations with IK

So I have an animation for holding a gun. I need to rotate the shoulders and the spine for the character to aim up/down. From what I understood, Unity's default IK doesn't support modifying animations, but posing instead, which is the opposite of what i want. How can I modify certain properties of animations through IK/scripting? Apologies for my poor English and explaining and thanks in advance.

Comment
Add comment
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

1 Reply

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

Answer by Cherno · May 13, 2015 at 05:54 PM

I answered a similar question a few weeks agho, but I can't find the thread. Anyway, you need to apply and changes to a bone's transform in LateUpdate() to ensure it gets applied after any manipulations from animations took place.

As for IK, there are IK solutions on the Asset store, I use SimpleIK, it's only $2.

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 Kissanaattori · May 13, 2015 at 06:01 PM 0
Share

I tried using this script without any effect:

 void LateUpdate ()
     {
         float armRotation = Input.GetAxisRaw("RightVertical") * 2f;
         if(ikActive)
         {
             if(rightArmJoint != null)
             {
                 rightArmJoint.transform.Rotate(new Vector3(armRotation, 0, 0));
             }
             if(leftArmJoint != null)
             {
                 leftArmJoint.transform.Rotate(new Vector3(armRotation, 0, 0));
             }
         }
     }



avatar image Cherno · May 13, 2015 at 06:06 PM 0
Share

I think the problem with your script is that it works... But now as you intend. transform.Rotate gets called, but in the next frame, i.e. immediately after, the animation kicks in again, and then transform.Rotate again, and so on, so there is no effect. Ins$$anonymous$$d, change the rotation of a bone to a set value ins$$anonymous$$d of rotating towards it gradually.

avatar image Kissanaattori · May 13, 2015 at 06:45 PM 0
Share

Hey, it worked! Thanks. Now I just have to fix the bugs. :P

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

20 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

Related Questions

Using IK the head is not returning smooth to his natural look position how can I fix it ? 0 Answers

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Trouble with animation with Forge Networking Remastered in MP 0 Answers

What is the proper way to wait for an Animator Controller to update? 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