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 /
This question was closed May 29, 2014 at 01:01 AM by meat5000 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by meat5000 · Apr 26, 2014 at 07:01 PM · animatormecanimrighumanoid

Mecanim - Bone Target Matching = Whole object translation!

I'm trying to fangle my way through target matching with Mecanim. When I perform "attack" I wanted the Player hand to migrate towards the specified point "enemyHead". Everything is working at the required points except that instead of the hand moving it pulls the entire model, sliding across the floor until the hand is located close to the specified point.

Is this all I'm going to get out of it? I don't see a way to mask the rig for specific bones. Am I being too hopeful or am I missing something?

The ideal situation I was hoping to see is that the attack swing would happen as normal except the hand would go through the desired point. Of course, it seems this is far from the case.

I've set up a scene with a functioning Mecanim rigged character and another object which is simply an enemy model. In the following script for simplicity I drag the enemy "Head" bone object to the inspector field.

  private var matchAnimator : Animator;
     
     public var enemyHead : Transform;
         
     function Start ()
     {
         matchAnimator = GetComponent(Animator);
     }
     
     function Update ()
     {
         if(matchAnimator)
         {
             if(matchAnimator.GetCurrentAnimatorStateInfo(1).IsName("attack"))
             {
                 Debug.Log("Attacking!!");
                 matchAnimator.MatchTarget(enemyHead.position, enemyHead.rotation, AvatarTarget.RightHand,new MatchTargetWeightMask(Vector3(1.0,1.0,1.0), 0), 0.44, 0.55);
             }
         }
     }
Comment
Add comment · Show 3
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 meat5000 ♦ · Apr 27, 2014 at 12:15 PM 0
Share

I'm starting to think no-one uses $$anonymous$$atchTarget as it doesn't do what it says on the tin...

avatar image meat5000 ♦ · Apr 27, 2014 at 07:35 PM 0
Share

Hmm, that seems closer to $$anonymous$$atchTarget than $$anonymous$$atchTarget itself :D Unfortunately, it's pro only so out of my bounds for the moment. I'm familiar with I$$anonymous$$ from the $$anonymous$$odeller but I never knew what functions existed in Unity for using it. Now that I see it, $$anonymous$$atchTarget looks like a very poor substitute.

The advantage of $$anonymous$$atchTarget was supposedly that you could use it during an animation. I was going to use it to hit heads and bounce off shields. Seems I can't do that :D

Back to the drawing board!

Thanks for the reply Loius. +1

avatar image meat5000 ♦ · Apr 28, 2014 at 10:29 AM 0
Share

I tried a custom I$$anonymous$$ script which was supposed to work on 2 bones and this seems to work in very much the same way, dragging my character around!

EDIT: Changed all the transforms in the script, now it seems to behave well. Added to Controller to enable/disable the I$$anonymous$$Control script between two points of an animation, so during an attack the hand is directed towards the specified object.

The I$$anonymous$$Control script came from a free I$$anonymous$$ package on Asset store. It's a bit glitchy but has all the basics in there for $$anonymous$$anual I$$anonymous$$. Bit of tweaking, it'll look good.

1 Reply

  • Sort: 
avatar image
1
Best Answer

Answer by Loius · Apr 27, 2014 at 07:24 PM

I've never touched match target, but if it's like normal IK there should be a setting to change how many bones it affects - in your case you only want to affect the hand and the two arm bones I imagine.

Does this link help? http://docs.unity3d.com/Documentation/Manual/InverseKinematics.html

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 meat5000 ♦ · May 29, 2014 at 01:01 AM 0
Share

Converted yours to answer as it is what brought me to the conclusion : it's the intended behaviour of $$anonymous$$atchTarget, I$$anonymous$$ is the way to go, custom or built-in.

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

Parenting generic weapon to Humanod breaks Humanoid's animation 1 Answer

Hand rig generating errors on import 0 Answers

Use Humanoid Animations with aditional bones 2 Answers

Extra bones mess up with humanoid animations 1 Answer

Humanoid fingers not deforming properly 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