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 Vicomte · Feb 10, 2014 at 09:22 PM · animationmecanimspeedblend treelinear

Are mecanim blend trees linear?

Hey there people,

So I was looking into manipulating movement speed of a character in mecanim, and someone suggested using a blend tree of the same animation in different speeds and blend between them using a float that I can set from the script, sounds good.

The thing is though, I set my blend tree to 1D blending, from 0.5 to 2. Accordingly I set my animation speeds to 0.5 for the slow one and 2 for the fast one.

It seems that the end points work correctly, 0.5 and 2 indeed result in a corrent animation speed.

but 0.5 is actually 50% movement speed of my character, so most of the time the float is set to 1, and I expected the animation to blend linearly and get a value of 1.

I don't know if I'm missing anything, but to me it seems that the animation is slower than that. That also suggests that the blend tree isn't blending linearly, which seems wierd.

Anyone got an idea?

Thanks ahead.

[SOLVED]

Hey there,

thanks for the answer, I'm aware of what you talk about, that's not what I was trying to achieve.

I did solve the issue though, the thing is, the blending is indeed perfecrly linear as it should be, it is I who needed non-linear result, and now I see why.

The relationship between my float variable and my animation speed is a variant of y=m/x and not y=mx+n

I realized that when I was looking at the amount of frames it took the animation to play under different values of my float variable.

at 0.5 it took 30 frames.

at 1 it took 23 frames.

at 1.5 it took 15 frames.

at 2 it took 7 frames.

As expected, perfectly linear. BUT, what I needed is that at a value of 1 it would already play only 15 frames, 50% of the amount of frames it took 0.5 to play (30).

Then I realized that I need to pass not X to y = mx + n, where y is the animation speed.

But X so that my linear function will turn to y = m/x.

So I had to pass y = m(a) + n, where a = 1/x - n/m.

That way I can pass a non-linear represntation of my animation speed and get the linear blending act like I want it to, non-linear behaviour.

That works for me, hope it helps someone, that perhaps has the same issue :)

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 Void24 · Feb 10, 2014 at 10:48 PM

I don't think there is enough information here to be able to tell exactly what is wrong, but I will make my best estimate.

Keep in mind that 1 is not halfway between 0.5 and 2. If your slow animation is at 0.5 and fast at 2, expect a value of 1 to be a blend of 66% slow animation and 33% fast animation. This would be the correct linear blend.

Set your Fast animation at 1.5 if you want a value of 1 to be a half and half blend.

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 Vicomte · Feb 11, 2014 at 12:26 AM

Hey there,

thanks for the answer, I'm aware of what you talk about, that's not what I was trying to achieve.

I did solve the issue though, the thing is, the blending is indeed perfecrly linear as it should be, it is I who needed non-linear result, and now I see why.

The relationship between my float variable and my animation speed is a variant of y=m/x and not y=mx+n

I realized that when I was looking at the amount of frames it took the animation to play under different values of my float variable.

at 0.5 it took 30 frames.

at 1 it took 23 frames.

at 1.5 it took 15 frames.

at 2 it took 7 frames.

As expected, perfectly linear. BUT, what I needed is that at a value of 1 it would already play only 15 frames, 50% of the amount of frames it took 0.5 to play (30).

Then I realized that I need to pass not X to y = mx + n, where y is the animation speed.

But X so that my linear function will turn to y = m/x.

So I had to pass y = m(a) + n, where a = 1/x - n/m.

That way I can pass a non-linear represntation of my animation speed and get the linear blending act like I want it to, non-linear behaviour.

That works for me, hope it helps someone, that perhaps has the same issue :)

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

19 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

Related Questions

UnityEditor.Animations.AnimatorControllerLayer.SetOverrideMotion not working 0 Answers

Leg crossing while blending strafe animations? 0 Answers

U4.3.4: Mecanim blend trees, no more old docs? 1 Answer

mecanim animation runs at random speed on iOS 0 Answers

Mecanim - changing animation clip speed, through script? 4 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