Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 Menatombo · Aug 08, 2015 at 06:35 AM · mecanimlegacy

Can I use the animation component with a mecanim rigged character?

Is it possible to use the animation component (not animator) with a character that has a mecanim humanoid rig? I haven't been able to figure this one out yet, but I would love to, because I can't seem to wrap my head around mecanim. I can't get characters to grapple with each other using mecanim, but I can with the animation component and my scripts.

So, is it possible?

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

3 Replies

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

Answer by Demonicdaron · Aug 08, 2015 at 10:57 AM

It would be easier to answer if you were a bit more specific on what you intend to do with the animation component, but in broad terms, you can get some information about the current animation being played using the AnimatorStateInfo or AnimatorClipInfo. However, to control the animations you have to use the mecanim way, so use the parameters/states and all the other stuff.

This doesn't mean that you must use mecanim! you can still use the animation component and manage the animations yourself, the humanoid type shouldnt give you any issue.

Comment
Add comment · Show 2 · 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 Menatombo · Aug 09, 2015 at 07:39 PM 0
Share

What I'm trying to do is trigger an animation on collision. I have a test dummy which I called TD. So, I want to have the Player go to the test dummy and play the attack animation on an ontriggerenter or oncollisionenter and stop playing when the player moves away from it. I haven't seen anything like this documented. I don't want to overload the mecanim controller with dozens of animations for different objects. So, I was thinking I could trigger the animation from the animation component ins$$anonymous$$d. I'm just now reading about layers and such and trying to wrap my head more about $$anonymous$$ecanim at the moment. I'm co$$anonymous$$g from a more legacy way of animating.

avatar image Menatombo · Aug 11, 2015 at 01:40 AM 1
Share

Thank you!! I finally got it. $$anonymous$$odified a bit of your code there and boop... It works. Thanks so very much!

avatar image
0

Answer by Demonicdaron · Aug 10, 2015 at 09:50 PM

If you just want to trigger the animation when colliding, can't you add a trigger collider to the dummy, add a script to the dummy where you have:

 void OnTriggerEnter(collider other) {
     if (other.CompareTag("Player")) {
         yourAnimator.SetTrigger/SetBool/SetFloat("YourParameter", yourValue);
     }
 }
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 Demonicdaron · Aug 10, 2015 at 09:50 PM

If you just want to trigger the animation when colliding, can't you add a trigger collider to the dummy, add a script to the dummy where you have:

 void OnTriggerEnter(collider other) {
     if (other.CompareTag("Player")) {
         yourAnimator.SetTrigger/SetBool/SetFloat("YourParameter", yourValue);
     }
 }
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 Menatombo · Aug 11, 2015 at 07:37 PM 0
Share

This is what I did only slightly modified, but it works swim$$anonymous$$gly. So glad I can continue on to the next steps of my project! Thank you so much for your insight and input.

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

24 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

Related Questions

Can Mecanim & Legacy animation be used on the same character? 1 Answer

Is it possible to use a mecanim animation with the legacy Animation component? 0 Answers

Why do legacy & humanoid animations look different on the same character? 1 Answer

Animation must be marked as Legacy, however there is no way to do so. 1 Answer

Use Legacy animation in Mecanim 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