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 /
avatar image
0
Question by konstantin_lozev · May 01, 2016 at 01:49 PM · animationanimatoranimator controlleranimationcurve

Animator parameter does not pick the value of the animation curve with the same name

Hi, everyone, I am trying to detect a certain point/range in my animation clip from script and I read that the thing to do is to add to the Animator Controller that has the animation a float parameter with the exact name as the animation curve. However, this simply does not work for my project. Any ideas?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by FortisVenaliter · May 01, 2016 at 03:36 PM

No, that won't work. AnimatorController variables get their values from code. and use them for animation decisions, not the other way around.

There are two ways you can do this. You can do it entirely in code, looking at the time values in the Animator's current active clip, or use animation events.

Comment
Add comment · Show 5 · 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 konstantin_lozev · May 02, 2016 at 05:18 AM 0
Share

@ FortisVenaliter - I am pretty sure it's possible http://docs.unity3d.com/$$anonymous$$anual/AnimationParameters.html In fact, that's how they trigger the shot effects in the S$$anonymous$$lth Tutorial. I have it working now, I think the issue was that it needed the animation curve to be on all animations in the animator controller...,

avatar image FortisVenaliter konstantin_lozev · May 03, 2016 at 04:54 AM 0
Share

Interesting... the docs seem vague on the subject; I've never seen it done, sorry.

avatar image konstantin_lozev FortisVenaliter · May 03, 2016 at 07:35 AM 0
Share

True, it's very vaguely described and I have only seen it on this video of the s$$anonymous$$lth tutorial https://www.youtube.com/watch?v=c_1Y-iXaQA8∈dex=23&list=PLX2vGYjWbI0QGyfO8P$$anonymous$$Y1pC8xcRb0X-nP . That's why I could not find a way how to troubleshoot my case, since no one seems to use that feature...

Show more comments
avatar image Likendor konstantin_lozev · Mar 06, 2017 at 12:06 PM 0
Share

Hello. You're almost right. But it's not neccessary to add curves for all(!) animations. You should add it just on the animation clip that is placed on the animation state machine and state of which should be detected. For example, if you have animation clip "Walk", use it on the state machine for walking animation of your avatar, and wish to detect when your avatar maximally raises the leg during walking - you should create a curve exactly for this clip ("Walk"). Otherwise it will not work.

avatar image
0

Answer by floky · Aug 05, 2020 at 03:04 PM

A bit late to this party but I just wanted to leave this up-to-date answer in case it helps anyone else.

As stated by the Unity docs you can have an animator parameter automatically pick up values from an animation curve as long as the animation is being used by the animator controller state. Otherwise the parameter will just have the default set value or any value set by your scripts.

Some extra details are provided at the bottom of this page: https://docs.unity3d.com/2020.1/Documentation/Manual/AnimationCurvesOnImportedClips.html

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

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Display additional animation on top of other animations 0 Answers

Animator Override Controller changed at runtime doesn't always play the animations correctly 1 Answer

How to handle multiple animation variants 1 Answer

Wrap Mode in animator not working properly 0 Answers

Set the time of an animation keyframe per script? 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