Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by canis · Feb 28, 2018 at 06:38 PM · animatortargetanimation scriptmatchmatching

Trying to understand target matching

So I read all those document, and trying to implement match target, but result are not always expected. Problems :

  • match target stop before it reach target

  • AFTER match target complete, something a unexpected force may append on my model.


I had read the API document, and sort out some tips to apply match target.

  1. match target only available on BaseLayer

  2. when (animator.IsInTransition(0) == true) you CANNOT apply match target, warning will append in console

  3. need to wait until GetCurrentAnimatorStateInfo(0).IsName(XXX) return true, which mean it's the animation you wanted to apply MatchTarget.

  4. ensure the match target period are not overlap any other state, (2) happen and match target will cancel.

however, I still can't 100% fix the issue that I had mentioned above. well yeah... by follow the those rules, most of the time work, but not all of it... I record a video to show these problem, https://youtu.be/ju163R2WtM4

and following are the related code used in that video.

 // process climb up ledge
 animator.SetTrigger(m_LedgeClimb.hash);
 
 // Stay position & wait for animation
 rigidbody.isKinematic = true;
 Collider surface = hitResult.collider;
 Physics.IgnoreCollision(avatar.self.capsule, surface, true);
 
 // Wait for matching
 while (!animator.isMatchingTarget)
 {
     // wait, until we able to use match target.
     if (!animator.IsInTransition(0))
     {
         animator.MatchTarget(landingPoint, predictFacing,
             m_UpperHandMatching.m_AvatarTarget,
             m_UpperHandMatching.GetWeightMask(),
             m_UpperHandMatching.m_Period.x,
             m_UpperHandMatching.m_Period.y);
     }
     yield return null;
 }
 
 // Matching
 while (animator.isMatchingTarget)
 {
     yield return null;
 }
 
 // re-apply physics
 Physics.IgnoreCollision(avatar.self.capsule, surface, false);
 rigidbody.isKinematic = false;

hope someone can point out what I'm missing, or the direction 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 canis · Feb 28, 2018 at 06:58 PM 0
Share

Physics.IgnoreCollision(); are the key to solve this issue, for some reason the collider that I got was wrong, so it didn't ignore anything in the video.

so yes, the above code are actually working. the glitch that I found was the collider are blocking Or overlapping the model itself. that's what it happen.

0 Replies

· Add your reply
  • Sort: 

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

135 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 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Would like to know if I doing well the animation transition? 1 Answer

Animator scripting error C# - Only WalkingRight Movement Animates 0 Answers

Copied character(enemy) not run the animations 0 Answers

How to make player rotate 180° and run that direction with mecanim + vice versa? 1 Answer

Animator vs Animation Clip via Scripting 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